Skip to content

Commit

Permalink
Use setuptools_scm to generate __version__ numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Jan 22, 2020
1 parent 21b9d77 commit 31a2bfa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
14 changes: 2 additions & 12 deletions astropy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import os
from warnings import warn

from .version import version as __version__

__minimum_python_version__ = '3.6'
__minimum_numpy_version__ = '1.16.0'
# ASDF is an optional dependency, but this is the minimum version that is
Expand Down Expand Up @@ -75,18 +77,6 @@ def _is_astropy_setup():
_is_astropy_source(main_mod.__file__))


try:
from .version import version as __version__
except ImportError:
# TODO: Issue a warning using the logging framework
__version__ = ''
try:
from .version import githash as __githash__
except ImportError:
# TODO: Issue a warning using the logging framework
__githash__ = ''


# The location of the online documentation for astropy
# This location will normally point to the current released version of astropy
if 'dev' in __version__:
Expand Down
6 changes: 1 addition & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@
# |version| and |release|, also used in various other places throughout the
# built documents.

# The short X.Y version.
version = astropy.__version__.split('-', 1)[0]
# The full version, including alpha/beta/rc tags.
release = astropy.__version__

release = version = astropy.__version__

# -- Options for the module index ---------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[build-system]
requires = ["setuptools",
"setuptools_scm",
"wheel",
"cython",
"jinja2",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[metadata]
name = astropy
version = 4.1.dev
provides = astropy
author = The Astropy Developers
author_email = [email protected]
Expand All @@ -26,6 +25,7 @@ packages = find:
requires = numpy
zip_safe = False
tests_require = pytest-astropy
setup_requires = setuptools_scm
install_requires = numpy>=1.16
python_requires = >=3.6

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst

import os
import builtins
from setuptools import setup

Expand All @@ -15,4 +16,4 @@
# programmatically.

from extension_helpers import get_extensions
setup(ext_modules=get_extensions())
setup(use_scm_version={'write_to': os.path.join('astropy', 'version.py')}, ext_modules=get_extensions())

0 comments on commit 31a2bfa

Please sign in to comment.