-
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.
Add conda packaging and deployment to accessnri channel
- Loading branch information
1 parent
b1539af
commit f404bad
Showing
8 changed files
with
844 additions
and
0 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 @@ | ||
umpost/_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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
PY_VERSION: 3.10 | ||
|
||
jobs: | ||
|
||
conda: | ||
name: Build with conda and upload | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-tags: true | ||
fetch-depth: 0 | ||
|
||
- name: Setup conda environment | ||
uses: conda-incubator/setup-miniconda@11b562958363ec5770fef326fe8ef0366f8cbf8a | ||
with: | ||
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 | ||
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
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 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,13 @@ | ||
name: um2nc | ||
|
||
channels: | ||
- conda-forge | ||
- accessnri | ||
- coecms | ||
- defaults | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{% 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: um2nc | ||
version: "{{ version }}" | ||
|
||
build: | ||
noarch: python | ||
number: 0 | ||
script: "{{ python }} -m pip install . -vv" | ||
entry_points: | ||
{% for name, script in project.get('scripts', {}).items() %} | ||
- {{ name }} = {{ script }} | ||
{% endfor %} | ||
|
||
source: | ||
path: ../ | ||
|
||
requirements: | ||
host: | ||
- python | ||
- pip | ||
- setupools >=61.0.0 | ||
- versioneer | ||
run: | ||
- python >=3.10 | ||
{% for dep in project.get('dependencies', []) %} | ||
- {{ dep }} | ||
{% endfor %} | ||
|
||
test: | ||
imports: | ||
- umpost | ||
requires: | ||
- pytest | ||
source_files: | ||
- test/** | ||
commands: | ||
- py.test | ||
|
||
about: | ||
home: https://github.com/access-nri/um2nc-standalone | ||
license: Apache Software | ||
license_family: Apache | ||
summary: "Tool to convert fieldsfiles into netCDF format. Used for post-processing UM climate model output" | ||
|
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,46 @@ | ||
[project] | ||
name = "um2nc" | ||
authors = [ | ||
{name = "Ben Davies", email="[email protected]"}, | ||
{name = "Martin Dix", email="[email protected]"}, | ||
{name = "Spencer Wong", email="[email protected]"}, | ||
] | ||
maintainers = [ | ||
{ name = "ACCESS-NRI", email = "[email protected]" } | ||
] | ||
description = "Program to convert Unified Model output files in fields file format to netCDF" | ||
license = { text = "Apache-2.0" } | ||
readme = "README.md" | ||
keywords = ["netCDF", "UM", "postprocessing"] | ||
dynamic = ["version"] | ||
dependencies = [ | ||
"numpy", | ||
"mule", | ||
"cftime", | ||
"netCDF4", | ||
"scitools-iris", | ||
"cf-units", | ||
"PyYAML", | ||
"f90nml", | ||
] | ||
[project.scripts] | ||
um2nc = "umpost.um2netcdf:main" | ||
|
||
[tool.versioneer] | ||
VCS = "git" | ||
style = "pep440" | ||
versionfile_source = "umpost/_version.py" | ||
versionfile_build = "umpost/_version.py" | ||
tag_prefix = "" | ||
parentdir_prefix = "umpost-" | ||
|
||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"setuptools>64", | ||
"versioneer[toml]" | ||
] | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["umpost*"] | ||
namespaces = false |
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,7 @@ | ||
from setuptools import setup | ||
import versioneer | ||
|
||
setup( | ||
version=versioneer.get_version(), | ||
cmdclass=versioneer.get_cmdclass(), | ||
) |
Oops, something went wrong.