Skip to content

Commit

Permalink
maint: move to setuptools-scm
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed Aug 12, 2022
1 parent 326c4da commit 3d74a1c
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 2,460 deletions.
13 changes: 9 additions & 4 deletions .circleci/config.yml
Expand Up @@ -132,14 +132,17 @@ jobs:
name: Build Docker image
no_output_timeout: 60m
command: |
python3 -m pip install -U build "setuptools >= 45" wheel "setuptools_scm >= 6.2" \
setuptools_scm_git_archive pip twine docutils
# Inject MRIQC-WebAPI secret
if [ "${MRIQC_API_SECRET_TOKEN}" != "" ]; then
sed -i -E "s/<secret_token>/$MRIQC_API_SECRET_TOKEN/" mriqc/interfaces/webapi.py
sed -i -E "s/<secret_token>/$MRIQC_API_SECRET_TOKEN/" mriqc/data/reports/individual.html
grep -q -i $MRIQC_API_SECRET_TOKEN mriqc/interfaces/webapi.py
fi
# Get version, update files.
THISVERSION=$( python3 -c "from versioneer import get_version; print(get_version())" )
THISVERSION=$( python3 -m setuptools_scm )
if [[ ${THISVERSION:0:1} == "0" ]] ; then
echo "WARNING: latest git tag could not be found"
echo "Please, make sure you fetch all tags from upstream with"
Expand Down Expand Up @@ -677,7 +680,8 @@ jobs:
- run:
name: Start virtual environment
command: |
sudo python -m pip install "setuptools>=30.3.0" "pip>=10.0.1" twine docutils
sudo python -m pip install -U build "setuptools >= 45" wheel "setuptools_scm >= 6.2" \
setuptools_scm_git_archive pip twine docutils
python -m venv /tmp/venv
source /tmp/venv/bin/activate
- run:
Expand All @@ -691,7 +695,7 @@ jobs:
if [[ "${CIRCLE_TAG}" != "" ]]; then
echo "${CIRCLE_TAG}" > mriqc/VERSION
fi
THISVERSION=$( python -c "from versioneer import get_version; print(get_version())" )
THISVERSION=$( python3 -m setuptools_scm )
python -m pip install --user dist/*.tar.gz
mkdir empty
cd empty
Expand All @@ -707,7 +711,8 @@ jobs:
- run:
name: Start virtual environment
command: |
sudo python -m pip install "setuptools>=30.3.0" "pip>=10.0.1" twine docutils
sudo python -m pip install -U build "setuptools >= 45" wheel "setuptools_scm >= 6.2" \
setuptools_scm_git_archive pip twine docutils
python -m venv /tmp/venv
source /tmp/venv/bin/activate
- run:
Expand Down
1 change: 0 additions & 1 deletion .dockerignore
Expand Up @@ -42,7 +42,6 @@ CONTRIBUTING.md
codecov.yml
docs
docs/**/*
get_version.py
long_description.rst
notebooks
notebooks/**/*
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
@@ -1,3 +1,6 @@
# setuptools-scm
mriqc/_version.py

.DS_Store

# IDE configuration
Expand Down
18 changes: 10 additions & 8 deletions MANIFEST.in
@@ -1,12 +1,14 @@
#documentation
recursive-include docs/build/html *
recursive-exclude .circleci/ *
recursive-exclude .docker/ *
recursive-exclude .github/ *
recursive-exclude .git/ *
recursive-exclude .maint/ *
recursive-exclude docs/ *
recursive-exclude test/ *

exclude .*
exclude Dockerfile

#data
recursive-include mriqc/data *

#Misc
include CHANGES.rst
include LICENSE
include NOTICE
include versioneer.py
include mriqc/_version.py
3 changes: 0 additions & 3 deletions NOTICE
Expand Up @@ -12,9 +12,6 @@ PCP Quality Assessment Protocol (QAP;
http://preprocessed-connectomes-project.github.io/quality-assessment-protocol)
by C. Craddock, S. Giavasis, D. Clark, Z. Shezhad, and J. Pellman.

This software redistributes the versioneer Python package, which is
Public domain source code.

This software is also distributed as a Docker container image.
The bootstraping file for the image ("Dockerfile") is licensed
under the MIT License.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Expand Up @@ -14,7 +14,7 @@
import os
from packaging.version import Version

from mriqc.__about__ import __version__, __copyright__
from mriqc import __version__, __copyright__

# Disable etelemetry during doc builds
os.environ["NIPYPE_NO_ET"] = "1"
Expand Down
18 changes: 0 additions & 18 deletions get_version.py

This file was deleted.

5 changes: 1 addition & 4 deletions mriqc/__about__.py
Expand Up @@ -21,10 +21,7 @@
# https://www.nipreps.org/community/licensing/
#
"""MRIQC."""
from mriqc._version import get_versions

__version__ = get_versions()["version"]
del get_versions
from mriqc._version import __version__

__copyright__ = "Copyright 2020 The NiPreps Developers"
__download__ = f"https://github.com/nipreps/mriqc/archive/{__version__}.tar.gz"
Expand Down
9 changes: 4 additions & 5 deletions mriqc/__init__.py
Expand Up @@ -25,9 +25,8 @@
:abbr:`IQMs (image quality metrics)` to used in :abbr:`QAPs (quality
assessment protocols)` for :abbr:`MRI (magnetic resonance imaging)`.
"""
from mriqc.__about__ import __copyright__, __version__
from mriqc._version import __version__

__all__ = [
"__copyright__",
"__version__",
]
__copyright__ = "Copyright 2022, The NiPreps Developers"
__download__ = f"https://github.com/nipreps/mriqc/archive/{__version__}.tar.gz"
__all__ = ["__version__", "__copyright__", "__download__"]

0 comments on commit 3d74a1c

Please sign in to comment.