Skip to content

Commit

Permalink
chore: Update setup.py to allow installing from a source bundle, and …
Browse files Browse the repository at this point in the history
…only build the sdist package.
  • Loading branch information
andrewjw committed Jul 9, 2024
1 parent d7257a8 commit fde0a0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

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(
Expand Down

0 comments on commit fde0a0b

Please sign in to comment.