Skip to content

Commit

Permalink
Setuptools scm (#65)
Browse files Browse the repository at this point in the history
* match numpy version requirements

* Make use of setuptools_scm for release version
  • Loading branch information
jcapriot authored Jul 7, 2023
1 parent 30b5d91 commit 0fc33d2
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 51 deletions.
4 changes: 0 additions & 4 deletions .bumpversion.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test_with_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
conda list
conda config --show
conda install --quiet --yes pip numpy scipy "matplotlib>=3.5.0" ipython cython;
conda install --quiet --yes discretize libdlf utm pytest pytest-cov graphviz
conda install --quiet --yes discretize libdlf setuptools_scm utm pytest pytest-cov graphviz
pip install -r requirements_dev.txt
- name: Install Our Package
run: |
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
conda list
conda config --show
conda install --quiet --yes pip numpy scipy "matplotlib>=3.5.0" ipython cython;
conda install --quiet --yes discretize libdlf utm pytest pytest-cov graphviz
conda install --quiet --yes discretize libdlf setuptools_scm utm pytest pytest-cov graphviz
pip install -r requirements_dev.txt
- name: Prepare source distribution
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ docs/api/generated/*
# Jupyter
*.ipynb
geoana/kernels/_extensions/rTE.cpp

# setuptools_scm
geoana/version.py
8 changes: 6 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
global-include *.pyx
global-include *.pxd
prune .github
prune docs
prune examples
prune tests
exclude .coveragerc .gitignore MANIFEST.in setup.cfg
exclude requirements_dev.txt requirements.txt
34 changes: 0 additions & 34 deletions Makefile

This file was deleted.

9 changes: 5 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import os
from sphinx_gallery.sorting import FileNameSortKey
import shutil
from importlib.metadata import version

# 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
Expand Down Expand Up @@ -80,17 +81,17 @@

# General information about the project.
project = u'geoana'
copyright = u'2017-2018, SimPEG Team'
copyright = u'2017, SimPEG Team'
author = u'SimPEG Team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'0.4.1'
# The full version, including alpha/beta/rc tags.
release = u'0.4.1'
release = version('geoana')
# The short X.Y version.
version = '.'.join(release.split('.')[:2])

linkcheck_retries = 3
linkcheck_timeout = 500
Expand Down
15 changes: 14 additions & 1 deletion geoana/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@
from . import earthquake
from . import em

__version__ = '0.4.1'
__author__ = 'SimPEG developers'
__license__ = 'MIT'
__copyright__ = 'Copyright 2017 SimPEG developers'

# Version
try:
# - Released versions just tags: 0.8.0
# - GitHub commits add .dev#+hash: 0.8.1.dev4+g2785721
# - Uncommitted changes add timestamp: 0.8.1.dev4+g2785721.d20191022
from geoana.version import version as __version__
except ImportError:
# If it was not installed, then we don't know the version. We could throw a
# warning here, but this case *should* be rare. discretize should be
# installed properly!
from datetime import datetime

__version__ = "unknown-" + datetime.today().strftime("%Y%m%d")
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def configuration(parent_package="", top_path=None):
LONG_DESCRIPTION = ''.join(f.readlines())

metadata = dict(
name = 'geoana',
version = '0.4.1',
name='geoana',
python_requires=">=3.8",
setup_requires=[
"numpy>=1.8",
"numpy>=1.20",
"cython>=0.29",
"setuptools_scm",
],
install_requires = [
"numpy>=1.20",
Expand All @@ -64,7 +64,10 @@ def configuration(parent_package="", top_path=None):
download_url = 'https://github.com/simpeg/geoana',
classifiers=CLASSIFIERS,
platforms = ['Windows', 'Linux', 'Solaris', 'Mac OS-X', 'Unix'],
license='MIT License'
license='MIT License',
use_scm_version={
"write_to": os.path.join("geoana", "version.py"),
},
)

if len(sys.argv) >= 2 and (
Expand Down

0 comments on commit 0fc33d2

Please sign in to comment.