Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching from versioneer to setuptools-scm #165

Merged
merged 54 commits into from
Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b0b98e2
Switching from versioneer to setuptools-scm
Aug 31, 2021
0cfef98
black strikes
Aug 31, 2021
9d1910a
ignore pyproject.toml in build
Aug 31, 2021
6f55eb2
removing versioneer
Aug 31, 2021
2045001
removing versioneer legacy code and files
Aug 31, 2021
695534a
version
Sep 1, 2021
427fd90
remove versioneer from MANIFEST
Sep 1, 2021
c0f5e52
manif
Sep 1, 2021
b2d2d86
remove legacy setuptools code
Sep 1, 2021
b7226a4
install setuptools-scm in ci
Sep 1, 2021
2dd3c41
add build-system to .cfg?
Sep 1, 2021
f1a2561
black!
Sep 1, 2021
c405e7c
some more edits
Sep 1, 2021
5b3e3aa
black
Sep 1, 2021
765f05d
exclude _version.py from black
Sep 1, 2021
a7a6494
pyproject
Sep 1, 2021
2559b91
remove build-require from .cfg
Sep 1, 2021
a192a27
major refactoring of setup
Sep 1, 2021
094feef
include version.py
Sep 1, 2021
6355a6d
remove flake8
Sep 1, 2021
3643b65
version
Sep 1, 2021
00be70e
src to xrft
Sep 1, 2021
3de7f91
brute force
Sep 1, 2021
50fe4e7
revert
Sep 1, 2021
5d65e02
update version with setuptools_scm
Sep 1, 2021
1bbb18a
black (sigh)
Sep 1, 2021
52dd70b
version
Sep 1, 2021
b192bed
desperation
Sep 1, 2021
7ffdf39
black reformatting
Sep 1, 2021
53c53f8
testing things
Sep 1, 2021
807f0c9
forgot to push updated __init__
Sep 1, 2021
374f425
poetry?
Sep 1, 2021
759c443
copy pasting from pangeo-forge
Sep 1, 2021
8a959f6
pkg_resources
Sep 1, 2021
2b4aaef
no commenting out
Sep 1, 2021
f3f5ff2
precommit
Sep 1, 2021
1b5dde7
revert to only black in precommit
Sep 1, 2021
43e79c1
version in .cfg
Sep 1, 2021
64fb2d0
try .version
Sep 1, 2021
8c432bc
release.yml
Sep 2, 2021
c0a17b5
release
Sep 2, 2021
586bb95
pre-commit
Sep 2, 2021
e51a04f
remove env
Sep 2, 2021
62e56fb
comment out import
Sep 2, 2021
da68441
comment out import
Sep 2, 2021
9011da5
setuptools in ci
Sep 2, 2021
811396e
setuptools as requirement
Sep 2, 2021
468d5f8
no changes to secrets
Sep 3, 2021
8782f7b
edits based on review
Sep 3, 2021
ed6df4c
turning on for all PRs
Sep 3, 2021
ef3abbc
syntax error in release
Sep 3, 2021
a630380
try to fix release.yaml
rabernat Sep 10, 2021
0c144f4
make release run on PRs
rabernat Sep 10, 2021
4847118
change name of release workflow
rabernat Sep 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pre-commit

on:
pull_request:
push:
branches: [master]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't matter if you add this in the pre-commit workflow. It needs to be added in the workflow where you care about the version number. What you do in this workflow won't affect the other workflows.

- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Upload Python Package

name: Release Python Package

on:
release:
Expand All @@ -8,20 +9,21 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools setuptools-scm wheel twine
python -m pip install --upgrade setuptools setuptools-scm wheel twine toml
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python setup.py --version
twine check dist/*
twine upload dist/*

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ target/

# notebook
*/.ipynb_checkpoints/*

# Pyre type checker
.pyre/
_version.py
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
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

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include versioneer.py
include LICENSE
include xrft/_version.py
5 changes: 4 additions & 1 deletion ci/environment-py3.6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ dependencies:
- numpy
- numpy_groupies
- pytest
- pytest-cov
- pip
- black
- cftime
- setuptools
- pip:
- codecov
- pytest-cov
- pytest-xdist
- setuptools-scm
- toml
5 changes: 4 additions & 1 deletion ci/environment-py3.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ dependencies:
- numpy
- numpy_groupies
- pytest
- pytest-cov
- pip
- black
- cftime
- setuptools
- pip:
- codecov
- pytest-cov
- pytest-xdist
- setuptools-scm
- toml
5 changes: 4 additions & 1 deletion ci/environment-py3.8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ dependencies:
- numpy
- numpy_groupies
- pytest
- pytest-cov
- pip
- black
- cftime
- setuptools
- pip:
- codecov
- pytest-cov
- pytest-xdist
- setuptools-scm
- toml
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ coverage:

ignore:
- "setup.py"
- "versioneer.py"
- "setup.cfg"
- "pyproject.toml"
- "xrft/test/*"
- "xrft/__init__.py"
- "xrft/_version.py"
14 changes: 14 additions & 0 deletions pyproject.toml
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}'"

68 changes: 58 additions & 10 deletions setup.cfg
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 = takaya.uchida@univ-grenoble-alpes.fr
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
Expand All @@ -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
55 changes: 4 additions & 51 deletions setup.py
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 = "takaya@ldeo.columbia.edu"
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()
Loading