Browse Source

merge in branch "setupcfg"

master
heck 5 years ago
parent
commit
e52ba5ac01
  1. 15
      setup.cfg
  2. 3
      setup.py
  3. 6
      src/pEp/__init__.py
  4. 11
      tests/test_pep.py

15
setup.cfg

@ -1,7 +1,5 @@
[metadata]
name = pEp
#TODO: automate version pull from hg/git
version = 2.2.0-RC1
url = https://pep.foundation
download_url =
ext_package = pEp
@ -33,11 +31,14 @@ python_requires = >= 3.6
test_suite = tests
setup_requires =
setuptools >=38.3.0
install_requires =
setuptools >=38.3.0
tests_require =
# To automatically write the version from a SCM.
# Note: It fails with tags named as `Release_2.2.0-RC0`, because it is
# not conforming to semantic versioning, but it succeed with tags as
# `2.2.0-rc0`.
setuptools_scm
[options.extras_require]
# To install these dependencies, run pip install .[test]
test =
pytest
tox
[options.extras_require]
doc = sphinx

3
setup.py

@ -223,4 +223,7 @@ setup(
cmdclass={
'build_ext': BuildExtCommand,
},
# While not using a pyproject.toml, support setuptools_scm setup.cfg usage,
# see https://github.com/pypa/setuptools_scm/#setupcfg-usage
use_scm_version=True,
)

6
src/pEp/__init__.py

@ -2,7 +2,7 @@
# This file is being exectued upon 'import pEp'
#
# __all__ could be used to limit the symbols exported when using from <pkg> import *
from pkg_resources import DistributionNotFound, get_distribution
# Import all symbols EXCEPT the ones beginning with underscore into the current namespace
from native_pEp import *
@ -11,6 +11,10 @@ from native_pEp import *
# import the module
import native_pEp
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
print("Package is not installed.")
# Executed on module import
def init():

11
tests/test_pep.py

@ -0,0 +1,11 @@
"""Unit test for pEp package, not for subpackages or modules."""
from pEp import __version__
def test_pep_version():
""" Test that __version__ is not None or empty and is not 0.0.0."""
# We could also test that match the regex, but that is already a test in
# setuptools_scm itself.
assert __version__
assert __version__ != "0.0.0"
Loading…
Cancel
Save