-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* udpate PyPI GHA * remove setuptools_scm_git_archive * bump to 3.8 b/c that's what is used as min * update and add config * fix identation * run pre-commit * move some configs to pyproject.toml * move setup.py to pyproject.toml * don't use main * fix typo * let's rely only on the version file * tweak for a smaller sdist * fix license * list tests * don't list esmpy * no numba on py311 * drop py37 from the CIS * py38 as min * run pre-commit * Update .github/workflows/pypi.yaml Co-authored-by: David Huard <huard.david@ouranos.ca> --------- Co-authored-by: David Huard <huard.david@ouranos.ca>
- Loading branch information
1 parent
2ca1f2c
commit ef65251
Showing
17 changed files
with
132 additions
and
130 deletions.
There are no files selected for viewing
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
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,48 +1,55 @@ | ||
name: Upload xesmf to PyPI | ||
name: Publish to PyPI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
deploy: | ||
packages: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get tags | ||
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
shell: bash | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
- name: Get tags | ||
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
|
||
- name: Install build tools | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install setuptools setuptools-scm wheel twine check-manifest | ||
python -m pip install --upgrade build | ||
- name: Build tarball and wheels | ||
- name: Build binary wheel | ||
run: python -m build --sdist --wheel . --outdir dist | ||
|
||
- name: CheckFiles | ||
run: | | ||
python setup.py sdist | ||
python -m pip wheel . -w dist --no-deps | ||
ls dist | ||
python -m pip install --upgrade check-manifest | ||
check-manifest --verbose | ||
- name: Test the artifacts | ||
- name: Test wheels | ||
run: | | ||
python -m check_manifest --verbose | ||
# We cannot run this step b/c esmpy is not available on PyPI | ||
# cd dist && python -m pip install *.whl && cd .. | ||
python -m pip install --upgrade build twine | ||
python -m twine check dist/* | ||
# FIXME: failing at the moment b/c we don't have PyPI ownership | ||
# - name: Publish | ||
# env: | ||
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
# run: | | ||
# python -m twine upload dist/* | ||
|
||
- name: upload artifacs | ||
uses: actions/upload-artifact@v3 | ||
- name: Publish a Python distribution to PyPI | ||
if: success() && github.event_name == 'release' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
path: dist/* | ||
user: __token__ | ||
password: ${{ secrets.PYPI_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
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,8 +1,68 @@ | ||
[build-system] | ||
requires = ["setuptools>=41.2", "setuptools_scm", "wheel", "setuptools_scm_git_archive"] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"setuptools>=41.2", | ||
"setuptools_scm", | ||
"wheel", | ||
] | ||
|
||
[project] | ||
name = "xesmf" | ||
description = "Universal Regridder for Geospatial Data" | ||
license = {text = "MIT"} | ||
authors = [ | ||
{name = "Jiawei Zhuang", email = "jiaweizhuang@g.harvard.edu"}, | ||
] | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
'Development Status :: 4 - Beta', | ||
'License :: OSI Approved :: MIT License', | ||
'Operating System :: OS Independent', | ||
'Intended Audience :: Science/Research', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Topic :: Scientific/Engineering', | ||
] | ||
dynamic = [ | ||
"dependencies", | ||
"readme", | ||
"version", | ||
] | ||
[project.urls] | ||
documentation = "https://xesmf.readthedocs.io/en/latest/" | ||
homepage = "https://github.com/pangeo-data/xESMF" | ||
repository = "https://github.com/pangeo-data/xESMF" | ||
|
||
[tool.setuptools] | ||
packages = ["xesmf", "xesmf.tests"] | ||
license-files = ["LICENSE"] | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = {file = ["requirements.txt"]} | ||
readme = {file = "README.rst", content-type = "text/x-rst"} | ||
|
||
[tool.setuptools_scm] | ||
write_to = "xesmf/_version.py" | ||
write_to_template = "__version__ = '{version}'" | ||
|
||
[tool.black] | ||
line-length = 100 | ||
target-version = ['py38'] | ||
skip-string-normalization = true | ||
|
||
[tool.isort] | ||
known_first_party = "xesmf" | ||
known_third_party = ["cf_xarray", "cftime", "dask", "numba", "numpy", "pytest", "shapely", "sparse", "xarray"] | ||
multi_line_output = 3 | ||
include_trailing_comma = true | ||
force_grid_wrap = 0 | ||
combine_as_imports = true | ||
line_length = 100 | ||
skip = [ | ||
"setup.py", | ||
"doc/conf.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
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 @@ | ||
cf-xarray>=0.5.1 | ||
# We cannot list this here b/c it is not on PyPI. | ||
#esmpy>=8.0.0 | ||
numba >=0.55.2 | ||
numpy>=1.16 | ||
shapely | ||
sparse>=0.8.0 | ||
xarray>=0.16.2 |
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
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.