Skip to content

Commit a0965f3

Browse files
author
Zach Banks
committed
FIX: Read version in setup.py without __init__.py
1 parent d0c322b commit a0965f3

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

setup.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
import os
3+
from typing import Any, Dict
34

4-
from databento.version import __version__
55
from setuptools import find_packages, setup
66

77

@@ -12,6 +12,13 @@
1212
with open("README.md") as f:
1313
readme = f.read()
1414

15+
# Option 3 for single-sourcing version information, via
16+
# https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
17+
with open("databento/version.py") as f:
18+
version_globals: Dict[str, Any] = {}
19+
exec(f.read(), version_globals)
20+
version = version_globals["__version__"]
21+
1522
with open("requirements.txt", "r") as f:
1623
install_requires = f.read().splitlines(keepends=False)
1724

@@ -21,14 +28,14 @@
2128

2229
setup(
2330
name="databento",
24-
version=__version__,
31+
version=version,
2532
description="Official Python client library for Databento",
2633
long_description=readme,
27-
long_description_content_type="text/x-rst",
34+
long_description_content_type="text/markdown",
2835
author="Databento",
2936
author_email="[email protected]",
3037
url="https://github.com/databento/databento-python",
31-
license="MIT",
38+
license="Apache License 2.0",
3239
keywords="databento financial data API",
3340
packages=find_packages(exclude=["tests", "examples"]),
3441
zip_safe=False,
@@ -42,7 +49,7 @@
4249
},
4350
classifiers=[
4451
"Development Status :: 4 - Beta",
45-
"License :: OSI Approved :: MIT License",
52+
"License :: OSI Approved :: Apache Software License",
4653
"Operating System :: OS Independent",
4754
"Programming Language :: Python",
4855
"Programming Language :: Python :: 3.7",

0 commit comments

Comments
 (0)