Skip to content

Commit

Permalink
Merge pull request #38 from steven-murray/deploy-fix
Browse files Browse the repository at this point in the history
update deployment in travis and add version file
  • Loading branch information
MuellerSeb authored Mar 19, 2020
2 parents bd4a5f6 + 6e88724 commit 166b04e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ stages:
- lint
- test
- coverage
- name: test_deploy
if: (NOT type IN (pull_request)) AND (repo = steven-murray/hankel)
- name: deploy
if: (NOT type IN (pull_request)) AND (repo = steven-murray/hankel) AND (branch = master) AND (tag IS present)
if: (NOT type IN (pull_request)) AND (repo = steven-murray/hankel)

jobs:
include:
Expand Down Expand Up @@ -69,7 +67,7 @@ jobs:
name: Coverage on Linux

# Test Deploy source distribution
- stage: test_deploy
- stage: deploy
python: 3.8
name: Test Deploy
install: python -m pip install -U setuptools wheel twine
Expand All @@ -79,6 +77,7 @@ jobs:

# Deploy source distribution
- stage: deploy
if: tag IS present
python: 3.8
name: Deploy source distribution
install: python -m pip install -U setuptools wheel twine
Expand Down
6 changes: 2 additions & 4 deletions hankel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
get_h
"""
from pkg_resources import DistributionNotFound, get_distribution

from hankel.hankel import HankelTransform, SymmetricFourierTransform
from hankel.tools import get_h

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound: # pragma: nocover
from hankel._version import __version__
except ModuleNotFoundError: # pragma: nocover
# package is not installed
pass

Expand Down
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ def read(*names, **kwargs):
return fp.read()


def local_scheme(version):
"""Truncate the local version (eg. +xyz of 1.0.1.dev1+xyz) for Test PyPI."""
return ""


CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand Down Expand Up @@ -51,7 +56,14 @@ def read(*names, **kwargs):
author_email="[email protected]",
license="MIT",
extras_require={"dev": test_req + doc_req, "tests": test_req, "docs": doc_req},
use_scm_version=True,
use_scm_version={
"root": ".",
"relative_to": __file__,
"write_to": "hankel/_version.py",
"write_to_template": "__version__ = '{version}'",
"local_scheme": local_scheme,
"fallback_version": "0.0.0.dev0",
},
setup_requires=["setuptools_scm"],
url="https://github.com/steven-murray/hankel",
)

0 comments on commit 166b04e

Please sign in to comment.