Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
* Address dunamai import error when not installing from VCS
* Adress python version requirements to exclude py3.9, which is not
  yet supported by libgdal.
  • Loading branch information
jreniel committed Feb 22, 2021
1 parent da61e85 commit 948a462
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,38 @@
import subprocess
import sys


try:
from dunamai import Version
except ImportError:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'dunamai'])
subprocess.check_call(
[sys.executable, '-m', 'pip', 'install', 'dunamai']
)
from dunamai import Version # type: ignore[import]

try:
version = Version.from_any_vcs(
pattern='^(?P<base>\d+\.\d+\.\d+)(-?((?P<stage>[a-zA-Z]+)\.?(?P<revision>\d+)?))?$'
).serialize()
except RuntimeError:
version = '0.0.0'

subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'wheel'])

parent = pathlib.Path(__file__).parent.absolute()
conf = setuptools.config.read_configuration(parent / 'setup.cfg')
meta = conf['metadata']
setuptools.setup(
name=meta['name'],
version=Version.from_any_vcs().serialize(),
version=version,
author=meta['author'],
author_email=meta['author_email'],
description=meta['description'],
long_description=meta['long_description'],
long_description_content_type="text/markdown",
url=meta['url'],
packages=setuptools.find_packages(),
python_requires='>=3.6',
python_requires='>=3.6, <=3.8',
setup_requires=['setuptools_scm', 'setuptools>=41.2',
'netcdf-flattener>=1.2.0'],
include_package_data=True,
Expand Down

0 comments on commit 948a462

Please sign in to comment.