Skip to content

Commit

Permalink
Update version to data-based versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
finsberg committed Aug 2, 2019
1 parent f36e87b commit 61e02ef
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 88 deletions.
56 changes: 3 additions & 53 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "ldrb" %}
{% set version = "0.1.1" %}
{% set version = "2019.0" %}
{% set sha256="f315d41c6181011cb3657a3b1360303372481da163234d4335e679d00ed58ee5" %}

package:
Expand All @@ -16,61 +16,11 @@ build:
noarch: python

requirements:
build:
- python 3.6.4=0
run:
- h5py>=2.8.0
- mshr 2017.*
- mshr 2018
- quaternion
- blas=1.1 openblas
- boost 1.65.1
- boost-cpp 1.65.1=1
- bzip2 1.0.6
- ca-certificates 2017.11.5=0
- certifi 2017.11.5=py36_0
- cmake 3.10.0=1
- eigen 3.3.3=0
- expat 2.2.5=0
- fastcache 1.0.2=py36_0
- gmp 6.1.2=0
- gmpy2 2.0.8=py36_1
- hdf5 1.10.1=1
- icu 58.2=0
- krb5 1.14.2=0
- libgfortran 3.0.1
- libssh2 1.8.0=2
- libuv 1.11.0=0
- metis 5.1.0=3
- mpc 1.0.3=4
- mpfr 3.1.5=0
- mpmath 1.0.0=py_0
- ncurses 5.9=10
- numpy 1.13.3=py36_blas_openblas_200
- openblas 0.2.19=2
- openssl 1.0.2n=0
- pcre 8.39=0
- petsc 3.8.1=blas_openblas_0
- petsc4py 3.8.1=py36_1
- pip 9.0.1=py36_1
- pkg-config 0.29.1=2
- ply 3.10=py36_0
- ptscotch 6.0.4=4
- readline 7.0=0
- rhash 1.3.4=0
- scotch 6.0.4=3
- setuptools 38.2.4=py36_0
- six 1.11.0=py36_1
- slepc 3.8.0=blas_openblas_0
- slepc4py 3.8.0=py36_0
- sqlite 3.20.1=2
- suitesparse 4.5.4=blas_openblas_200
- swig 3.0.12=2
- sympy 1.1.1=py36_0
- tbb 2018_20170919=0
- tk 8.6.7=0
- xz 5.2.3=0
- zlib 1.2.11=0
- fenics 2017.2
- fenics 2018
test:
imports:
- ldrb
Expand Down
65 changes: 30 additions & 35 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@
from setuptools import find_packages, setup, Command

# Package meta-data.
NAME = 'ldrb'
DESCRIPTION = ('Laplace-Dirichlet Rule-based algorithm for assigning'
' myocardial fiber orientations.')
URL = 'https://github.com/finsberg/ldrb'
EMAIL = '[email protected]'
AUTHOR = 'Henrik Finsberg'
REQUIRES_PYTHON = '>=3.5.0'
VERSION = '0.2.0'
NAME = "ldrb"
DESCRIPTION = (
"Laplace-Dirichlet Rule-based algorithm for assigning"
" myocardial fiber orientations."
)
URL = "https://github.com/finsberg/ldrb"
EMAIL = "[email protected]"
AUTHOR = "Henrik Finsberg"
VERSION = "2019.0"

# What packages are required for this module to be executed?
REQUIRED = [
'h5py', 'numba', 'numpy-quaternion'
]
REQUIRED = ["h5py", "numba", "numpy-quaternion"]

# What packages are optional?
EXTRAS = {
Expand All @@ -41,31 +40,31 @@
# Import the README and use it as the long-description.
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
try:
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
with io.open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = "\n" + f.read()
except FileNotFoundError:
long_description = DESCRIPTION

# Load the package's __version__.py module as a dictionary.
about = {}
if not VERSION:
project_slug = NAME.lower().replace("-", "_").replace(" ", "_")
with open(os.path.join(here, project_slug, '__version__.py')) as f:
with open(os.path.join(here, project_slug, "__version__.py")) as f:
exec(f.read(), about)
else:
about['__version__'] = VERSION
about["__version__"] = VERSION


class UploadCommand(Command):
"""Support setup.py upload."""

description = 'Build and publish the package.'
description = "Build and publish the package."
user_options = []

@staticmethod
def status(s):
"""Prints things in bold."""
print('\033[1m{0}\033[0m'.format(s))
print("\033[1m{0}\033[0m".format(s))

def initialize_options(self):
pass
Expand All @@ -75,46 +74,44 @@ def finalize_options(self):

def run(self):
try:
self.status('Removing previous builds…')
rmtree(os.path.join(here, 'dist'))
self.status("Removing previous builds…")
rmtree(os.path.join(here, "dist"))
except OSError:
pass

self.status('Building Source and Wheel (universal) distribution…')
os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))
self.status("Building Source and Wheel (universal) distribution…")
os.system("{0} setup.py sdist bdist_wheel --universal".format(sys.executable))

self.status("Uploading the package to PyPI via Twine…")
os.system("python -m twine upload dist/*")

self.status('Uploading the package to PyPI via Twine…')
os.system('python -m twine upload dist/*')
self.status("Pushing git tags…")
os.system("git tag v{0}".format(about["__version__"]))
os.system("git push --tags")

self.status('Pushing git tags…')
os.system('git tag v{0}'.format(about['__version__']))
os.system('git push --tags')

sys.exit()


# Where the magic happens:
setup(
name=NAME,
version=about['__version__'],
version=about["__version__"],
description=DESCRIPTION,
long_description=long_description,
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
author=AUTHOR,
author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
packages=find_packages(exclude=["tests", "demos"]),
# If your package is a single module, use this instead of 'packages':
# py_modules=['mypackage'],

# entry_points={
# 'console_scripts': ['mycli=mymodule:cli'],
# },
install_requires=REQUIRED,
extras_require=EXTRAS,
include_package_data=True,
license='LGPL version 3 or later',
license="LGPL version 3 or later",
classifiers=[
# Trove classifiers
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand All @@ -124,7 +121,5 @@ def run(self):
# 'Programming Language :: Python :: Implementation :: CPython',
],
# $ setup.py publish support.
cmdclass={
'upload': UploadCommand,
},
cmdclass={"upload": UploadCommand},
)

0 comments on commit 61e02ef

Please sign in to comment.