Skip to content

Commit

Permalink
Merge pull request #3 from JacksonBurns/setup-dev
Browse files Browse the repository at this point in the history
get version from __init__
  • Loading branch information
JacksonBurns authored Apr 17, 2022
2 parents 636a18f + 0977503 commit 0d868fb
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os.path
import codecs
import pathlib
from setuptools import setup

Expand All @@ -7,10 +9,26 @@
# The text of the README file
README = (cwd / "README.md").read_text()


def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()


def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")


# This call to setup() does all the work
setup(
name="py2sambvca",
version="1.1.0",
version=get_version("py2sambvca/__init__.py"),
description="Simple thin client to interface python scripts with SambVca catalytic pocket Fortran calculator.",
long_description=README,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 0d868fb

Please sign in to comment.