Skip to content

Commit

Permalink
fix: changing version inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Sep 7, 2021
1 parent d52ad3f commit 6efca29
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion LoopStructural/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
from logging.config import dictConfig
import tempfile
from pathlib import Path
from .version import __version__
ch = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s ~ %(name)-12s ~ %(levelname)-10s ~ %(message)s')
ch.setFormatter(formatter)
ch.setLevel(logging.WARNING)
loggers = {}
__version__ = '1.2.2'
from .modelling.core.geological_model import GeologicalModel
from .utils import log_to_console, log_to_file, getLogger
logger = getLogger(__name__)
Expand Down
1 change: 1 addition & 0 deletions LoopStructural/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.2.2'
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[metadata]
20 changes: 7 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,13 @@

import numpy
import os
import codecs
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.")
package_root = os.path.abspath(os.path.dirname(__file__))

version = {}
with open(os.path.join(package_root, "LoopStructural/version.py")) as fp:
exec(fp.read(), version)
version = version["__version__"]

setup(
name="LoopStructural",
Expand All @@ -47,7 +41,7 @@ def get_version(rel_path):
'tqdm',
# 'pyamg'
],
version=get_version("LoopStructural/__init__.py"),
version=version,
packages=find_packages(),
ext_modules=cythonize("LoopStructural/interpolators/cython/*.pyx",compiler_directives={"language_level": "3"}),
include_dirs=[numpy.get_include()],
Expand Down

0 comments on commit 6efca29

Please sign in to comment.