From a39f0ab2134c2138fa307219facf1cc175cd8fbb Mon Sep 17 00:00:00 2001 From: Nicolas Braud-Santoni Date: Tue, 25 Jun 2019 20:20:23 -0700 Subject: [PATCH 1/2] Expose the version number programatically. This addresses the [feedback] I left Piper on the 1.0 release PR: i.e. the version info is now exposed programatically without duplicating it. [feedback]: https://github.com/ppb/ppb-vector/pull/23#discussion_r289222439 --- ppb_vector/__init__.py | 3 +++ setup.cfg | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ppb_vector/__init__.py b/ppb_vector/__init__.py index f791b4c6..cdcacb5c 100644 --- a/ppb_vector/__init__.py +++ b/ppb_vector/__init__.py @@ -5,6 +5,9 @@ __all__ = ('Vector',) +#: ppb_vector's current version. +#: It follows the semantic versioning convention. +__version__ = "1.0b1" # Anything convertable to a Vector, including lists, tuples, and dicts VectorLike = typing.Union[ diff --git a/setup.cfg b/setup.cfg index 56faa7de..11c3c6c3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = ppb-vector -version = 1.0b1 +version = attr: ppb_vector.__version__ author = Piper Thunstrom author_email = pathunstrom@gmail.com description = A basic game development Vector class. From 3f67c14aa642cb4fad30c09eed6585342e59ef58 Mon Sep 17 00:00:00 2001 From: Nicolas Braud-Santoni Date: Tue, 25 Jun 2019 20:29:21 -0700 Subject: [PATCH 2/2] setuptools: Update setup_requires In order for `version = attr: ppb_vector.__version__` to work, setuptools needs to be able to import `pbb_vector`, so its runtime dependencies are now setup-time dependencies too. --- setup.cfg | 2 -- setup.py | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 11c3c6c3..2def7ecf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,8 +22,6 @@ packages = ppb_vector python_requires = >= 3.6 zip_safe = True -setup_requires = pytest-runner - [aliases] test = pytest diff --git a/setup.py b/setup.py index ce402e03..257640f6 100755 --- a/setup.py +++ b/setup.py @@ -15,6 +15,8 @@ def requirements(section=None): # See setup.cfg for the actual configuration. setup( + # setup needs to be able to import the library, for attr: to work + setup_requires=requirements() + ['pytest-runner'], install_requires=requirements(), tests_require=requirements('tests'), )