diff --git a/pyproject.toml b/pyproject.toml index 96ad328..338b4c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ tag_format = "v{version}" version_variables = [ "glowprom/__init__.py:__version__" ] -build_command = "python3 setup.py sdist bdist_wheel" +build_command = "python3 setup.py sdist" [semantic_release.branches.main] match = "(main|master)" diff --git a/setup.py b/setup.py index 406c18f..6c38c0c 100644 --- a/setup.py +++ b/setup.py @@ -14,14 +14,22 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import os + import setuptools -from glowprom import __version__ +try: + from glowprom import __version__ +except ImportError: + import re + + with open('glowprom.egg-info/PKG-INFO') as f: + __version__ = re.search("^Version: (.*)$", f.read(), re.MULTILINE).group(1) with open("README.md", "r") as fh: long_description = fh.read() -with open('requirements.txt') as f: +with open('requirements.txt' if os.path.exists('requirements.txt') else 'glowprom.egg-info/requires.txt') as f: requirements = f.read().splitlines() setuptools.setup(