Skip to content

Commit

Permalink
fix(deploy): use semantic release for deployment to PyPI
Browse files Browse the repository at this point in the history
The version for PyPI was set to the hard-coded version in \__init__.py. This is now fixed.
  • Loading branch information
mostaphaRoudsari authored and Chris Mackey committed Jun 5, 2019
1 parent 36df671 commit 04834ae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
2 changes: 0 additions & 2 deletions ladybug_geometry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import sys

__version__ = '0.0.1'

# This is a variable to check if the library is a [+] library.
setattr(sys.modules[__name__], 'isplus', False)
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[semantic_release]
version_variable = ladybug_geometry/__init__.py:__version__

[bdist_wheel]
universal = 1

Expand Down
20 changes: 3 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
import re
import setuptools
import sys

with open("README.md", "r") as fh:
long_description = fh.read()

with open('ladybug_geometry/__init__.py', 'r') as fd:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(),
re.MULTILINE
).group(1)

try:
from semantic_release import setup_hook
setup_hook(sys.argv)
except ImportError:
pass

setuptools.setup(
name="ladybug-geometry",
version=version,
use_scm_version = True,
setup_requires=['setuptools_scm'],
author="Ladybug Tools",
author_email="[email protected]",
description="Ladybug geometry is a Python library that adds geometry objects and basic geometric computation to Ladybug.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ladybug-tools/ladybug-geometry",
packages=setuptools.find_packages(),
packages=setuptools.find_packages(exclude=["tests"]),
install_requires=[
],
classifiers=[
Expand Down

0 comments on commit 04834ae

Please sign in to comment.