Skip to content

Commit

Permalink
Continuous release via CI
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhelba committed Apr 9, 2019
1 parent e4fa1d3 commit 8251df8
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,5 @@
exclude .*
exclude Dockerfile
exclude tox.ini
prune .circleci
prune tests
22 changes: 22 additions & 0 deletions setup.py
@@ -1,5 +1,25 @@
import os

from setuptools import find_packages, setup


def prerelease_local_scheme(version):
"""
Return local scheme version unless building on master in CircleCI.
This function returns the local scheme version number
(e.g. 0.0.0.dev<N>+g<HASH>) unless building on CircleCI for a
pre-release in which case it ignores the hash and produces a
PEP440 compliant pre-release version number (e.g. 0.0.0.dev<N>).
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') == 'master':
return ''
else:
return get_local_node_and_date(version)


setup(
name='isic_challenge_scoring',
version='0.1',
Expand All @@ -9,4 +29,6 @@
packages=find_packages(exclude=['tests']),
python_requires='>=3.7.0',
install_requires=['click', 'numpy', 'pandas', 'pillow', 'scipy', 'scikit-learn'],
use_scm_version={'local_scheme': prerelease_local_scheme},
setup_requires=['setuptools_scm'],
)
17 changes: 17 additions & 0 deletions tox.ini
Expand Up @@ -34,6 +34,23 @@ commands =
[pytest]
addopts = --showlocals

[testenv:release]
basepython = python3
skipsdist = true
skip_install = true
passenv =
CIRCLE_BRANCH
TWINE_USERNAME
TWINE_PASSWORD
deps =
setuptools-git
setuptools-scm
twine
commands =
python setup.py sdist
twine check dist/*
twine upload --skip-existing dist/*

[flake8]
max-line-length = 100
show-source = True
Expand Down

0 comments on commit 8251df8

Please sign in to comment.