Skip to content

Commit

Permalink
Merge pull request #690 from effigies/maint/python_packaging
Browse files Browse the repository at this point in the history
MAINT: Add Python deployment to CircleCI
  • Loading branch information
chrisgorgo authored Jan 18, 2019
2 parents e5b3816 + ac394fd commit 7f3459d
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 68 deletions.
37 changes: 0 additions & 37 deletions bids_validator/version.py

This file was deleted.

35 changes: 35 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ jobs:
- run: ./node_modules/.bin/gulp build && rsync -av --exclude=".*" --exclude="node_modules" --exclude="src" --exclude="tests" . ~/web_version/
- store_artifacts:
path: ~/web_version/
pypi_precheck:
docker:
- image: alpine:3.8
steps:
- checkout
- run:
name: Set up environment
command: |
apk --no-cache add ca-certificates git build-base
- run:
name: Install Python 3 and update setuptools
command: |
apk --no-cache add python3 python3-dev py3-cffi
python3 -m pip install --upgrade pip setuptools wheel twine readme_renderer[md]
- run:
name: Check build and readme rendering
command: |
python3 setup.py sdist bdist_wheel
twine check dist/*
deployment:
docker:
- image: node:8.11.3-alpine
Expand All @@ -59,6 +78,17 @@ jobs:
# Set the version number
- run: sed -i -E "s/0.0.0/$CIRCLE_TAG/" package.json
- run: ./node_modules/.bin/publish
# Publish to PyPI
- run:
name: Install Python 3 and update setuptools
command: |
apk --no-cache add python3 python3-dev py3-cffi
python3 -m pip install --upgrade pip setuptools wheel twine
- run:
name: Build and push to PyPI
command: |
python3 setup.py sdist bdist_wheel
twine upload dist/*
# Update gh-pages demo site
- run: git config --global user.email circleci@circleci
- run: git config --global user.name CircleCI
Expand Down Expand Up @@ -91,10 +121,15 @@ workflows:
only: /.*/
tags:
only: /.*/
- pypi_precheck:
filters:
tags:
only: /.*/
- deployment:
requires:
- test
- githubPagesTest
- pypi_precheck
filters:
branches:
ignore: /.*/
Expand Down
31 changes: 30 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
[metadata]
description-file = README.md
name = bids-validator
url = https://github.com/bids-standard/bids-validator
author = PyBIDS developers
author_email = [email protected]
maintainer = BIDS Developers
maintainer_email = [email protected]
description = Validator for the Brain Imaging Data Structure
long_description = file:README.md
long_description_content_type="text/markdown"
license = MIT
classifiers =
Development Status :: 3 - Alpha
Environment :: Console
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python
Topic :: Scientific/Engineering

[options]
packages = find:
include_package_data = True

[options.package_data]
bids_validator =
rules/*.json
tsv/*.json

[bdist_wheel]
universal=1

[versioneer]
VCS = git
Expand Down
33 changes: 3 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,6 @@
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
from setuptools import setup
import versioneer


PACKAGES = find_packages()

# Get version and release info, which is all stored in bids/version.py
ver_file = os.path.join('bids_validator', 'version.py')
with open(ver_file) as f:
exec(f.read())

opts = dict(name=NAME,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
url=URL,
download_url=DOWNLOAD_URL,
license=LICENSE,
classifiers=CLASSIFIERS,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
platforms=PLATFORMS,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
packages=PACKAGES,
package_data=PACKAGE_DATA,
install_requires=REQUIRES)


if __name__ == '__main__':
setup(**opts)
setup(version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass())

0 comments on commit 7f3459d

Please sign in to comment.