def test_get_git_devstr(tmpdir): dirpath = str(tmpdir) warn_msg = "No git repository present at" # Verify as much as possible, but avoid dealing with paths on windows if not sys.platform.startswith('win'): warn_msg += " '{}'".format(dirpath) with catch_warnings(record=True) as w: devstr = get_git_devstr(path=dirpath) assert devstr == '0' assert len(w) == 1 assert str(w[0].message).startswith(warn_msg)
__import__(PACKAGENAME) package = sys.modules[PACKAGENAME] LONG_DESCRIPTION = package.__doc__ # Store the package name in a built-in variable so it's easy # to get from other parts of the setup infrastructure builtins._ASTROPY_PACKAGE_NAME_ = PACKAGENAME # VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386) VERSION = '0.1.dev' # Indicates if this version is a release version RELEASE = 'dev' not in VERSION if not RELEASE: VERSION += get_git_devstr(False) # Populate the dict of setup command overrides; this should be done before # invoking any other functionality from distutils since it can potentially # modify distutils' behavior. cmdclassd = register_commands(PACKAGENAME, VERSION, RELEASE) # Freeze build information in version.py generate_version_py(PACKAGENAME, VERSION, RELEASE, get_debug_option(PACKAGENAME)) # Treat everything in scripts except README.rst as a script to be installed scripts = [fname for fname in glob.glob(os.path.join('scripts', '*')) if os.path.basename(fname) != 'README.rst']
from astropy_helpers.git_helpers import get_git_devstr __all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] __title__ = "nihts_xcam" __summary__ = "Basic control software for the Xenics XEVA near-infrared slit-viewing camera on Lowell DCT NIHTS." __uri__ = "https://github.com/henryroe/NIHTS-xcam" # VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386) __version__ = "0.2.0dev" # Indicates if this version is a release version RELEASE = 'dev' not in __version__ if not RELEASE: __version__ += get_git_devstr(False) __author__ = "Henry Roe" __email__ = "*****@*****.**" __license__ = "MIT License" __copyright__ = "2017 %s" % __author__
__import__(PACKAGENAME) package = sys.modules[PACKAGENAME] LONG_DESCRIPTION = package.__doc__ # Store the package name in a built-in variable so it's easy # to get from other parts of the setup infrastructure builtins._ASTROPY_PACKAGE_NAME_ = PACKAGENAME # VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386) VERSION = '0.4.dev' # Indicates if this version is a release version RELEASE = 'dev' not in VERSION if not RELEASE: VERSION += get_git_devstr(False) # Populate the dict of setup command overrides; this should be done before # invoking any other functionality from distutils since it can potentially # modify distutils' behavior. cmdclassd = register_commands(PACKAGENAME, VERSION, RELEASE) # Freeze build information in version.py generate_version_py(PACKAGENAME, VERSION, RELEASE, get_debug_option(PACKAGENAME)) # Treat everything in scripts except README.rst as a script to be installed scripts = [ fname for fname in glob.glob(os.path.join('scripts', '*')) if os.path.basename(fname) != 'README.rst' ]
__all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] __title__ = "PyNOMAD" __summary__ = "Routines for accessing a self-hosted local copy of the USNO NOMAD stellar catalog" __uri__ = "https://github.com/henryroe/PyNOMAD" # VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386) __version__ = "0.1.6" # Indicates if this version is a release version RELEASE = 'dev' not in __version__ if not RELEASE: __version__ += get_git_devstr(False) __author__ = "Henry Roe" __email__ = "*****@*****.**" __license__ = "MIT License" __copyright__ = "2015 %s" % __author__
################################################################ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path root = path.abspath(path.dirname(__file__)) from pynrc.version import __version__ version = __version__ RELEASE = 'dev' not in version if not RELEASE: version += get_git_devstr(False) ################################################################ # shortcuts for publishing, tagging, testing ################################################################ if sys.argv[-1] == 'publish': os.system("python setup.py sdist upload") os.system("python setup.py bdist_wheel upload") print("You probably want to also tag the version now:") print(" python setup.py tag") sys.exit() # Requires .pypirc #[pypitest]
__import__(PACKAGENAME) package = sys.modules[PACKAGENAME] LONG_DESCRIPTION = package.__doc__ # Store the package name in a built-in variable so it's easy # to get from other parts of the setup infrastructure builtins._ASTROPY_PACKAGE_NAME_ = PACKAGENAME # VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386) VERSION = '0.3.dev' # Indicates if this version is a release version RELEASE = 'dev' not in VERSION if not RELEASE: git_devstr = get_git_devstr(False) if (git_devstr == '0') or (git_devstr == ''): import linetools.version version_version = linetools.version.version VERSION = version_version else: VERSION = VERSION + git_devstr # Populate the dict of setup command overrides; this should be done before # invoking any other functionality from distutils since it can potentially # modify distutils' behavior. cmdclassd = register_commands(PACKAGENAME, VERSION, RELEASE) # Adjust the compiler in case the default on this platform is to use a # broken one. #adjust_compiler(PACKAGENAME)
# built documents. # The full version, including alpha/beta/rc tags. release = setup_cfg['version'] # The short X.Y version. version = re.match(r'([\d\.]*)(\D*\d?)', setup_cfg['version']).group(1) if version.endswith('.'): # e.g. "3.0.dev", which splits into groups "3.0." and "dev" version = version[:-1] if release.endswith('dev'): # once the sphinx-astropy-theme is ready, just copy over the git_helpers.py file # into this repo - it has been long-term stable so the helpers aren't needed # just for this. from astropy_helpers.git_helpers import get_git_devstr release = release + get_git_devstr(path=os.path.join(os.path.split(__file__)[0],'..')) # -- Options for HTML output -------------------------------------------------- # A NOTE ON HTML THEMES # The global astropy configuration uses a custom theme, 'bootstrap-astropy', # which is installed along with astropy. A different theme can be used or # the options for this theme can be modified by overriding some of the # variables set in the global configuration. The variables set in the # global configuration are listed below, commented out. # Please update these texts to match the name of your package. html_theme_options = {