forked from payu-org/payu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request payu-org#403 from dougiesquire/issue-398
Update to packaging tools and logic
- Loading branch information
Showing
20 changed files
with
869 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
payu/_version.py export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,24 @@ | ||
name: CD | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
conda: | ||
name: build and deploy to conda | ||
if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup conda environment | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: "latest" | ||
python-version: 3.11 | ||
environment-file: conda/environment.yml | ||
auto-update-conda: false | ||
auto-activate-base: false | ||
show-channel-urls: true | ||
|
||
- name: Build and upload the conda package | ||
uses: uibcdf/[email protected] | ||
with: | ||
meta_yaml_dir: conda | ||
python-version: 3.11 | ||
user: accessnri | ||
label: main | ||
token: ${{ secrets.anaconda_token }} | ||
env: | ||
PY_VERSION: 3.11 | ||
|
||
jobs: | ||
pypi-build: | ||
name: Build package for PyPI | ||
if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
if: github.repository == 'payu-org/payu' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
python-version: ${{ env.PY_VERSION }} | ||
|
||
- run: | | ||
python3 -m pip install --upgrade build && python3 -m build | ||
|
@@ -54,7 +31,6 @@ jobs: | |
# Split build and publish to restrict trusted publishing to just this workflow | ||
needs: ['pypi-build'] | ||
name: Publish to PyPI.org | ||
if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
|
@@ -65,7 +41,34 @@ jobs: | |
path: artifact/ | ||
|
||
- name: Publish package distributions to PyPI | ||
# This is version v1.8.10 | ||
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e | ||
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11 | ||
with: | ||
packages-dir: artifact/ | ||
|
||
conda: | ||
name: Build with conda and upload | ||
if: github.repository == 'payu-org/payu' | ||
runs-on: ubuntu-latest | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup conda environment | ||
uses: conda-incubator/setup-miniconda@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1 | ||
with: | ||
packages_dir: artifact/ | ||
miniconda-version: "latest" | ||
python-version: ${{ env.PY_VERSION }} | ||
environment-file: conda/environment.yml | ||
auto-update-conda: false | ||
auto-activate-base: false | ||
show-channel-urls: true | ||
|
||
- name: Build and upload the conda package | ||
uses: uibcdf/action-build-and-upload-conda-packages@c6e7a90ad5e599d6cde76e130db4ee52ad733ecf # v1.2.0 | ||
with: | ||
meta_yaml_dir: conda | ||
python-version: ${{ env.PY_VERSION }} | ||
user: accessnri | ||
label: main | ||
token: ${{ secrets.anaconda_token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[MAIN] | ||
|
||
# Files or directories to be skipped. They should be base names, not | ||
# paths. | ||
ignore=_version.py |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ dependencies: | |
- anaconda-client | ||
- conda-build | ||
- conda-verify | ||
- versioneer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,45 @@ | ||
{% set data = load_setup_py_data(setup_file='../setup.py', from_recipe_dir=True) %} | ||
{% set version = data.get('version') %} | ||
{% set pyproj = load_file_data('../pyproject.toml', from_recipe_dir=True) %} | ||
{% set project = pyproj.get('project') %} | ||
|
||
package: | ||
name: payu | ||
version: {{ GIT_DESCRIBE_TAG }} | ||
version: "{{ version }}" | ||
|
||
build: | ||
noarch: python | ||
number: {{ GIT_DESCRIBE_NUMBER }} | ||
script: "{{ PYTHON }} -m pip install . --no-deps" | ||
number: 0 | ||
script: "{{ PYTHON }} -m pip install . -vv" | ||
entry_points: | ||
- payu = payu.cli:parse | ||
- payu-run = payu.subcommands.run_cmd:runscript | ||
- payu-collate = payu.subcommands.collate_cmd:runscript | ||
- payu-profile = payu.subcommands.profile_cmd:runscript | ||
- payu-sync = payu.subcommands.sync_cmd:runscript | ||
- payu-branch = payu.subcommands.branch_cmd:runscript | ||
- payu-clone = payu.subcommands.clone_cmd:runscript | ||
- payu-checkout = payu.subcommands.checkout_cmd:runscript | ||
{% for name, script in project.get('scripts', {}).items() %} | ||
- {{ name }} = {{ script }} | ||
{% endfor %} | ||
|
||
source: | ||
git_url: ../ | ||
path: ../ | ||
|
||
requirements: | ||
build: | ||
- python <=3.11 | ||
- pbr | ||
- setuptools | ||
host: | ||
- python | ||
- pip | ||
- setuptools >=61.0.0 | ||
- versioneer | ||
run: | ||
- python <=3.11 | ||
- f90nml >=0.16 | ||
- yamanifest >=0.3.4 | ||
- PyYAML | ||
- python-dateutil | ||
- tenacity | ||
- requests | ||
- cftime | ||
# The following two requirements are from the security | ||
# extra for the pypi package | ||
- pyOpenSSL >=0.14 | ||
- cryptography>=1.3.4 | ||
- GitPython >=3.1.40 | ||
- ruamel.yaml >=0.18.5 | ||
- python >=3.9 | ||
{% for dep in project.get('dependencies', []) %} | ||
- {{ dep }} | ||
{% endfor %} | ||
|
||
test: | ||
imports: | ||
- payu | ||
commands: | ||
- payu list | ||
|
||
|
||
about: | ||
home: https://github.com/payu-org/payu/ | ||
license: Apache Software | ||
license_family: APACHE | ||
summary: "A climate model workflow manager for supercomputing environments" | ||
doc_url: https://payu.readthedocs.io/en/latest/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.