Skip to content

Commit

Permalink
Replace versioneer with setuptools-scm (#61)
Browse files Browse the repository at this point in the history
Remove all versioneer related files. Update setup.py to work with
setuptools-scm. Update boule/version.py to work with setuptools-scm.
Remove setup.cfg and move all flake8 configuration to .flake8 file. Add
setuptools-scm to requirements.txt and environment.yml.
  • Loading branch information
santisoler authored Oct 26, 2020
1 parent 3cfb203 commit 0f33049
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 2,433 deletions.
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
ignore = E203, E266, E501, W503, F401, E741
max-line-length = 88
max-complexity = 10
exclude =
boule/_version.py
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
#############################################################################
# Run tests, build the docs, and deploy if needed
test:
name: ${{ matrix.os }} py${{ matrix.python }} ${{ matrix.dependencies }} [test]
name: ${{ matrix.os }} py${{ matrix.python }} ${{ matrix.dependencies }}
runs-on: ${{ matrix.os }}-latest
strategy:
# Otherwise, the workflow would stop if a single job fails. We want to
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
# Need to fetch more than the last commit so that versioneer can
# Need to fetch more than the last commit so that setuptools-scm can
# create the correct version string. If the number of commits since
# the last release is greater than this, the version still be wrong.
# Increase if necessary.
Expand All @@ -72,7 +72,7 @@ jobs:
# to be able to push to GitHub.
persist-credentials: false

# Need the tags so that versioneer can form a valid version number
# Need the tags so that setuptools-scm can form a valid version number
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'

Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
# to be able to push to GitHub.
persist-credentials: false

# Need the tags so that versioneer can form a valid version number
# Need the tags so that setuptools-scm can form a valid version number
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'

Expand All @@ -64,11 +64,10 @@ jobs:

- name: Build source and wheel distributions
run: |
# Change the versioneer format to "pre" so that the commit hash isn't
# included (PyPI doesn't allow it). Can't do this permanently because
# we rely the hash to indicate to the tests that this is a local
# verison instead of a published version.
sed --in-place "s/pep440/pep440-pre/g" setup.cfg
# Change setuptools-scm local_scheme to "no-local-version" so the
# local part of the version isn't included, making the version string
# compatible with Test PyPI.
sed --in-place "s/node-and-date/no-local-version/g" setup.py
python setup.py sdist bdist_wheel
echo ""
echo "Generated files:"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
###############################################################################
jobs:
black:
name: black [format]
name: black
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -40,7 +40,7 @@ jobs:
run: make black-check

flake8:
name: flake8 [style]
name: flake8
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -63,7 +63,7 @@ jobs:
run: make flake8

pylint:
name: pylint [style]
name: pylint
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ include LICENSE.txt
include CODE_OF_CONDUCT.md
include CONTRIBUTING.md
include AUTHORS.md
include versioneer.py
include requirements.txt
3 changes: 3 additions & 0 deletions boule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

ELLIPSOIDS = [WGS84, GRS80, MARS]

# Get the version number through setuptools-scm
__version__ = version.version


def test(doctest=True, verbose=True):
"""
Expand Down
Loading

0 comments on commit 0f33049

Please sign in to comment.