Skip to content

Commit

Permalink
Replace versioneer with setuptools_scm. (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasraabe authored Apr 26, 2021
1 parent 8edf916 commit e41483f
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 2,638 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,4 @@ docs/source/tutorials/.sid_*
# sid
.sid/
src/__init__.py
src/sid/_version.py
37 changes: 23 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
repos:
- repo: https://github.com/econchick/interrogate
rev: 1.3.2
hooks:
- id: interrogate
args: [
-v,
--fail-under=78,
--generate-badge=docs/source/_static/images/interrogate_badge.svg,
src,
]
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-added-large-files
args: ['--maxkb=500']
- id: check-case-conflict
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: check-yaml
exclude: meta.yaml
- id: debug-statements
- id: end-of-file-fixer
- id: check-added-large-files
args: ['--maxkb=500']
- id: fix-byte-order-marker
- id: forbid-new-submodules
- id: mixed-line-ending
- id: no-commit-to-branch
args: [--branch, main]
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0 # Use the ref you want to point at
hooks:
Expand All @@ -32,7 +31,7 @@ repos:
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char
- repo: https://github.com/asottile/pyupgrade
rev: v2.12.0
rev: v2.13.0
hooks:
- id: pyupgrade
args: [--py36-plus]
Expand All @@ -41,6 +40,10 @@ repos:
hooks:
- id: reorder-python-imports
types: [python]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.17.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
Expand Down Expand Up @@ -81,6 +84,12 @@ repos:
rev: 0.9.0a1
hooks:
- id: doc8
- repo: https://github.com/econchick/interrogate
rev: 1.3.2
hooks:
- id: interrogate
args: [-v, --fail-under=78, src]
pass_filenames: false
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
hooks:
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
include CITATION
include LICENSE
include versioneer.py
include src/sid/_version.py

recursive-include src *.csv

Expand Down
3 changes: 0 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ sid
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://sid-dev.readthedocs.io/en/latest/_static/images/interrogate_badge.svg
:target: https://github.com/econchick/interrogate

.. end-badges
Expand Down
2 changes: 0 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ coverage:
ignore:
- ".tox/**/*"
- "setup.py"
- "versioneer.py"
- "src/sid/_version.py"
6 changes: 6 additions & 0 deletions docs/rtd_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ channels:

dependencies:
- python >= 3.6
- pip
- setuptools_scm
- toml

# Sphinx dependencies.
- furo
Expand All @@ -24,3 +27,6 @@ dependencies:
- python-snappy
- seaborn
- tqdm

- pip:
- ../
54 changes: 0 additions & 54 deletions docs/source/_static/images/interrogate_badge.svg

This file was deleted.

4 changes: 3 additions & 1 deletion docs/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ all releases are available on `Anaconda.org
<https://anaconda.org/covid-19-impact-lab/sid>`_.


0.0.4 - 2021-xx-xx
0.0.4 - 2021-04-24
------------------

- :gh:`92` adds an interface for rapid tests.
Expand All @@ -26,6 +26,8 @@ all releases are available on `Anaconda.org
- :gh:`107` allows compute derived state variables which can be used across model
features to save some computations.
- :gh:`108` enhances dtype conversion of random contact models.
- :gh:`110` fixes a ``SettingWithCopy`` warning in ``contacts.py``.
- :gh:`111` leads the migration from ``versioneer`` to ``setuptools_scm``.


0.0.3 - 2021-03-23
Expand Down
31 changes: 12 additions & 19 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
# Configuration file for the Sphinx documentation builder.
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# Configuration file for the Sphinx documentation builder. This file only contains a
# selection of the most common options. For a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
from datetime import datetime
import datetime as dt


sys.path.insert(0, os.path.abspath("../../src"))


import sid # noqa: E402
from pkg_resources import get_distribution


# -- Project information -----------------------------------------------------

project = "sid"
year = datetime.now().year
year = dt.datetime.now().year
copyright = f"2020-{year}, Janos Gabler, Tobias Raabe, Klara Röhrl" # noqa: A001
author = "Janos Gabler, Tobias Raabe, Klara Röhrl"
version = sid.__version__
release = version

# The version, including alpha/beta/rc tags, but not commit hash and datestamps
release = get_distribution("sid-dev").version.split("+")[0]
# The short X.Y version.
version = release


# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -146,7 +139,7 @@
html_show_copyright = True

html_theme_options = {
"sidebar_hide_name": True,
"sidebar_hide_name": False,
"navigation_with_keys": True,
}

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sid
:end-before: end-installation

More information can be found in the `discussion paper <https://www.iza.org/
publications/ dp/13899>`_ or in the four following chapters of the documentation.
publications/dp/13899>`_ or in the four following chapters of the documentation.


Documentation
Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ channels:
dependencies:
- python >=3.6
- pip
- setuptools_scm
- toml

# Conda
- anaconda-client
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]

[tool.setuptools_scm]
write_to = "src/sid/_version.py"

[tool.nbqa.config]
isort = "setup.cfg"
black = "pyproject.toml"
Expand Down
61 changes: 52 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,53 @@
# See the docstring in versioneer.py for instructions. Note that you must re-run
# 'versioneer.py setup' after changing this section, and commit the resulting files.
[metadata]
name = sid_dev
description = Simulate the spread of COVID-19 with different policies.
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://github.com/covid-19-impact-lab/sid
author = Janos Gabler, Tobias Raabe, Klara Roehrl
author_email = janos.gabler@gmail.com
license = MIT
license_file = LICENSE
platforms = any
classifiers =
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Scientific/Engineering
project_urls =
Changelog = https://sid-dev.readthedocs.io/en/latest/changes.html
Documentation = https://sid-dev.readthedocs.io/en/latest
Github = https://github.com/covid-19-impact-lab/sid
Tracker = https://github.com/covid-19-impact-lab/sid/issues

[versioneer]
VCS = git
style = pep440
versionfile_source = src/sid/_version.py
versionfile_build = sid/_version.py
tag_prefix = v
parentdir_prefix = sid-
[options]
packages = find:
install_requires =
bokeh
dask
fastparquet
numba>=0.48
numpy
pandas>=1
python-snappy
seaborn
tqdm
python_requires = >=3.6
include_package_data = True
package_dir =
=src
zip_safe = False

[options.packages.find]
where = src

[check-manifest]
ignore =
src/sid/_version.py
Loading

0 comments on commit e41483f

Please sign in to comment.