Skip to content

Commit

Permalink
FEAT: add dynamic version (#160)
Browse files Browse the repository at this point in the history
* FEAT: add coincurve dynamic version

* (ref) cleanup that helps with local tox -e fmt
  • Loading branch information
MementoRC authored Mar 19, 2024
1 parent e781de0 commit c434c05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source =
tests

omit =
*/_version.py
*/_windows_libsecp256k1.py
*/test_bench.py

Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@

LIB_TARBALL_URL = f'https://github.com/bitcoin-core/secp256k1/archive/{UPSTREAM_REF}.tar.gz'

globals_ = {}
with open(join(COINCURVE_ROOT_DIR, 'src', 'coincurve', '_version.py')) as fp:
exec(fp.read(), globals_) # noqa S102
__version__ = globals_['__version__']

# We require setuptools >= 3.3
if [int(i) for i in setuptools_version.split('.', 2)[:2]] < [3, 3]:
raise SystemExit(
Expand Down Expand Up @@ -115,7 +120,7 @@ def has_c_libraries(self):

setup(
name='coincurve',
version='19.0.1',
version=__version__,

description='Cross-platform Python CFFI bindings for libsecp256k1',
long_description=open('README.md', 'r').read(),
Expand Down
11 changes: 11 additions & 0 deletions src/coincurve/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file is imported from __init__.py and exec'd from setup.py

MAJOR = 19
MINOR = 0
MICRO = 1
RELEASE = True

__version__ = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

if not RELEASE:
__version__ += '.dev0'

0 comments on commit c434c05

Please sign in to comment.