-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switching from versioneer to setuptools-scm (#165)
- Loading branch information
Takaya Uchida
authored
Sep 11, 2021
1 parent
744209f
commit 491cc24
Showing
16 changed files
with
147 additions
and
2,542 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,14 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/[email protected] |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Check and Maybe Release Python Package | ||
|
||
on: [push, pull_request] | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade setuptools setuptools-scm wheel twine toml | ||
- name: Build package | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
python setup.py --version | ||
twine check dist/* | ||
- name: Publish to pypi | ||
if: startsWith(github.event.ref, 'refs/tags') | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
twine upload dist/* |
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 |
---|---|---|
|
@@ -58,3 +58,7 @@ target/ | |
|
||
# notebook | ||
*/.ipynb_checkpoints/* | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
_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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
|
||
repos: | ||
- repo: https://github.com/python/black | ||
|
||
- repo: https://github.com/python/black | ||
rev: 21.6b0 | ||
hooks: | ||
- id: black | ||
- id: black | ||
|
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,2 +1,2 @@ | ||
include versioneer.py | ||
include LICENSE | ||
include xrft/_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
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
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,14 @@ | ||
# pyproject.toml | ||
[build-system] | ||
requires = [ | ||
"setuptools>=45", | ||
"setuptools_scm[toml]>=6.0", | ||
"setuptools_scm_git_archive", | ||
"wheel" | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "xrft/_version.py" | ||
write_to_template = "__version__ = '{version}'" | ||
|
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,19 +1,63 @@ | ||
[metadata] | ||
description-file = README.rst | ||
name = xrft | ||
description = Discrete Fourier Transform with xarray | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst; charset=UTF-8 | ||
url = https://github.com/xgcm/xrft | ||
author = xrft Developers | ||
author_email = [email protected] | ||
license = MIT | ||
license_file = LICENSE | ||
classifiers = | ||
Development Status :: 5 - Production/Stable | ||
Intended Audience :: Science/Research | ||
License :: OSI Approved :: MIT License | ||
Natural Language :: English | ||
Operating System :: OS Independent | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Topic :: Scientific/Engineering | ||
project_urls = | ||
Documentation = https://xrft.readthedocs.io/en/latest/ | ||
Source = https://github.com/xgcm/xrft | ||
Tracker = https://github.com/xgcm/xrft/issues | ||
|
||
[options] | ||
zip_safe = False | ||
packages = find: | ||
platforms = any | ||
include_package_data = True | ||
install_requires = | ||
xarray | ||
dask | ||
numpy | ||
pandas | ||
scipy | ||
setuptools | ||
python_requires = >=3.6 | ||
setup_requires = | ||
setuptools_scm | ||
pytest-runner | ||
extra_requires = | ||
cftime | ||
numpy_groupies | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[aliases] | ||
test=pytest | ||
|
||
[versioneer] | ||
VCS = git | ||
style = pep440 | ||
versionfile_source = xrft/_version.py | ||
versionfile_build = xrft/_version.py | ||
tag_prefix = v | ||
parentdir_prefix = xrft- | ||
[options.extras_require] | ||
test = | ||
pytest >= 6.2.2 | ||
pytest-cov | ||
all = | ||
%(test)s | ||
|
||
[flake8] | ||
exclude = __init__.py,versioneer.py,.eggs,doc | ||
exclude = __init__.py,pyproject.toml,.eggs,doc | ||
ignore = | ||
# whitespace before ':' - doesn't work well with black | ||
E203 | ||
|
@@ -23,4 +67,8 @@ ignore = | |
# do not assign a lambda expression, use a def | ||
E731 | ||
# line break before binary operator | ||
W503 | ||
W503 | ||
|
||
[isort] | ||
known_first_party=xrft | ||
known_third_party=dask,numpy,pandas,pytest,pytest_lazyfixture,setuptools,sphinx_book_theme,xarray,zarr |
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,53 +1,6 @@ | ||
import os | ||
import versioneer | ||
from setuptools import setup, find_packages | ||
#!/usr/bin/env python | ||
|
||
PACKAGES = find_packages() | ||
import setuptools | ||
|
||
DISTNAME = "xrft" | ||
LICENSE = "MIT" | ||
AUTHOR = "xrft Developers" | ||
AUTHOR_EMAIL = "[email protected]" | ||
URL = "https://github.com/xgcm/xrft" | ||
CLASSIFIERS = [ | ||
"Development Status :: 4 - Beta", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Intended Audience :: Science/Research", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Topic :: Scientific/Engineering", | ||
] | ||
|
||
INSTALL_REQUIRES = ["xarray", "dask", "numpy", "pandas", "scipy"] | ||
EXTRAS_REQUIRE = ["cftime", "numpy_groupies"] | ||
SETUP_REQUIRES = ["pytest-runner"] | ||
TESTS_REQUIRE = ["pytest >= 2.8", "coverage"] | ||
|
||
DESCRIPTION = "Discrete Fourier Transform with xarray" | ||
|
||
|
||
def readme(): | ||
with open("README.rst") as f: | ||
return f.read() | ||
|
||
|
||
setup( | ||
name=DISTNAME, | ||
version=versioneer.get_version(), | ||
cmdclass=versioneer.get_cmdclass(), | ||
license=LICENSE, | ||
author=AUTHOR, | ||
author_email=AUTHOR_EMAIL, | ||
classifiers=CLASSIFIERS, | ||
description=DESCRIPTION, | ||
long_description=readme(), | ||
install_requires=INSTALL_REQUIRES, | ||
setup_requires=SETUP_REQUIRES, | ||
tests_require=TESTS_REQUIRE, | ||
url=URL, | ||
packages=find_packages(), | ||
) | ||
if __name__ == "__main__": | ||
setuptools.setup() |
Oops, something went wrong.