generated from ACCESS-NRI/template
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #9 from ACCESS-NRI/python-package
Setup python packaging for pypi and conda
- Loading branch information
Showing
12 changed files
with
3,172 additions
and
1 deletion.
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,9 @@ | ||
channels: | ||
- conda-forge | ||
- accessnri | ||
- default | ||
|
||
dependencies: | ||
- anaconda-client | ||
- conda-build | ||
- conda-verify |
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,38 @@ | ||
{% set data = load_setup_py_data(setup_file='../setup.py', from_recipe_dir=True) %} | ||
{% set version = data.get('version') %} | ||
|
||
package: | ||
name: med_diagnostics | ||
version: "{{ version }}" | ||
|
||
source: | ||
url: "https://pypi.io/packages/source/a/med-diagnostics/med_diagnostics-{{ version }}.tar.gz" | ||
|
||
build: | ||
noarch: python | ||
number: 0 | ||
script: "{{ PYTHON }} -m pip install . -vv" | ||
|
||
requirements: | ||
host: | ||
- python | ||
- pip | ||
- versioneer | ||
run: | ||
- python >=3.10 | ||
- access-nri-intake | ||
- apscheduler | ||
- panel | ||
- matplotlib | ||
|
||
about: | ||
home: https://github.com/ACCESS-NRI/med-live-diagnostics | ||
license: Apache Software | ||
license_family: APACHE | ||
summary: "Interactive monitoring and diagnostic analyses of ACCESS climate models" | ||
doc_url: https://med-live-diagnostics.readthedocs.io/en/latest | ||
|
||
extra: | ||
recipe-maintainers: | ||
- mtetley | ||
- rbeucher |
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 @@ | ||
src/med_diagnostics/_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,20 @@ | ||
--- | ||
name: Bug report | ||
about: Create an issue to report a bug | ||
title: "[BUG] <description of the bug>" | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
# Describe the bug | ||
|
||
<Replace this text with a clear and concise description of the bug. You can add screen shots by dragging them into this panel. If your code errored, please include the traceback here.> | ||
|
||
# To Reproduce | ||
|
||
<Replace this text with a description of how to reproduce the bug. See [these guidelines](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) on how to provide a good bug report. Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly.> | ||
|
||
# Additional context | ||
|
||
<Replace this text with any other relevant information about the problem> |
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,24 @@ | ||
--- | ||
name: Feature request | ||
about: Create an issue to suggest an idea for this project | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
# Is your feature request related to a problem? Please describe. | ||
|
||
<Replace this text with a clear and concise description of what the problem is.> | ||
|
||
# Describe the feature you'd like | ||
|
||
<Replace this text with a clear and concise description of what you want to happen.> | ||
|
||
# Describe alternatives you've considered | ||
|
||
<Replace this text with a clear and concise description of any alternative solutions or features you've considered.> | ||
|
||
# Additional context | ||
|
||
<Replace this text with any other relevant information about your suggestion> |
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,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,62 @@ | ||
name: CD | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
pypi: | ||
name: build and deploy to PyPI | ||
if: github.repository == 'ACCESS-NRI/MED-live-diagnostics' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
runs-on: "ubuntu-latest" | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install build dependencies | ||
run: python -m pip install build twine | ||
|
||
- name: Build distributions | ||
shell: bash -l {0} | ||
run: | | ||
git clean -xdf | ||
pyproject-build | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
conda: | ||
name: build and deploy to conda | ||
needs: pypi | ||
if: always() && needs.pypi.result == 'success' | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
|
||
- 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 }} | ||
|
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,36 @@ | ||
[project] | ||
name = "med-diagnostics" | ||
authors = [ | ||
{ name = "ACCESS-NRI" }, | ||
] | ||
description = "ACCESS MED-Diagnostics" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
license = {text = "APACHE-2.0"} | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
] | ||
dependencies = ["apscheduler", "access-nri-intake", "panel", "matplotlib"] | ||
dynamic = ["version"] | ||
|
||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"setuptools >= 61.0.0", | ||
"versioneer[toml]", | ||
] | ||
|
||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
|
||
[tool.versioneer] | ||
VCS = "git" | ||
style = "pep440" | ||
versionfile_source = "src/med_diagnostics/_version.py" | ||
versionfile_build = "med_diagnostics/_version.py" | ||
tag_prefix = "v" | ||
parentdir_prefix = "med_diagnostics-" |
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,8 @@ | ||
#!/usr/bin/env python | ||
from setuptools import setup | ||
import versioneer | ||
|
||
setup( | ||
version=versioneer.get_version(), | ||
cmdclass=versioneer.get_cmdclass(), | ||
) |
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 +1,3 @@ | ||
from . import data, diagnostics, ui, session | ||
from . import data, diagnostics, ui, session | ||
from . import _version | ||
__version__ = _version.get_versions()['version'] |
Oops, something went wrong.