Skip to content

Commit df2594c

Browse files
committed
Add setuptools_scm to use version from tag
1 parent b4f4143 commit df2594c

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

prestapyt/version.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
from importlib.metadata import version, PackageNotFoundError
2+
3+
14
__author__ = "Guewen Baconnier <[email protected]>"
2-
__version__ = "0.9.1"
5+
6+
try:
7+
__version__ = version("prestapyt")
8+
except PackageNotFoundError:
9+
# package is not installed
10+
__version__ = "0.0.0"

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal=1

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,27 @@
1515
def read(fname):
1616
return open(os.path.join(os.path.dirname(__file__), fname)).read()
1717

18-
with open('prestapyt/version.py') as f:
19-
# execute the file so __version__ is in the current scope
20-
exec(f.read())
2118

2219
setup(
2320
# Basic package information.
2421
name = 'prestapyt',
25-
version = __version__,
22+
use_scm_version=True,
2623

2724
# Packaging options.
2825
include_package_data = True,
2926

3027
# Package dependencies.
3128
install_requires = ['requests','future'],
29+
setup_requires=[
30+
'setuptools_scm',
31+
],
3232

3333
# Metadata for PyPI.
34+
3435
author = 'Guewen Baconnier',
3536
author_email = '[email protected]',
3637
license = 'GNU AGPL-3',
37-
url = 'http://github.com/guewen/prestapyt',
38+
url = 'http://github.com/prestapyt/prestapyt',
3839
packages=['prestapyt'],
3940
keywords = 'prestashop api client rest',
4041
description = 'A library to access Prestashop Web Service from Python.',

0 commit comments

Comments
 (0)