Skip to content

Commit

Permalink
Update dependency to Core v26 and remove Python2 checks from CI
Browse files Browse the repository at this point in the history
Merge pull request #68 from openfisca/to-core-v26
  • Loading branch information
sandcha authored Feb 27, 2019
2 parents 4223e43 + e09d567 commit 93a92fe
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 89 deletions.
103 changes: 17 additions & 86 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# CircleCI 2.0 configuration file. See <https://circleci.com/docs/2.0/language-python/>.
version: 2
jobs:
build_python2:
build:
docker:
- image: python:2.7.15
- image: python:3.7

steps:
- checkout

- restore_cache:
key: v1-py2-deps-{{ checksum "setup.py" }}
key: v1-py3-deps-{{ checksum "setup.py" }}

- run:
name: Create a virtualenv
command: |
mkdir -p /tmp/venv/country_template
virtualenv /tmp/venv/country_template
python -m venv /tmp/venv/country_template
echo "source /tmp/venv/country_template/bin/activate" >> $BASH_ENV
- run:
Expand All @@ -25,99 +25,33 @@ jobs:
# pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH#egg=OpenFisca-Core[web-api] # use a specific branch of OpenFisca-Core
- save_cache:
key: v1-py2-deps-{{ checksum "setup.py" }}
key: v1-py3-deps-{{ checksum "setup.py" }}
paths:
- /tmp/venv/country_template

- save_cache:
key: v1-py2-build-{{ .Revision }}
key: v1-py3-build-{{ .Revision }}
paths:
- dist

- run:
name: Run tests
command: make test

- run:
name: Check version number has been properly updated
command: |
git fetch
.circleci/is-version-number-acceptable.sh
deploy_python2:
docker:
- image: python:2.7.15
environment:
PYPI_USERNAME: openfisca-bot # Edit this value to replace it by your Pypi username
# PYPI_PASSWORD: this value is set in CircleCI's web interface; do not set it here, it is a secret!

steps:
- checkout

- restore_cache:
key: v1-py2-deps-{{ checksum "setup.py" }}

- restore_cache:
key: v1-py2-build-{{ .Revision }}

- run:
name: Check for functional changes
command: if ! .circleci/has-functional-changes.sh ; then circleci step halt ; fi

- run:
name: Upload a Python package to Pypi
command: |
source /tmp/venv/country_template/bin/activate
twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD
- run:
name: Publish a git tag
command: .circleci/publish-git-tag.sh

build_python3:
check_version:
docker:
- image: python:3.7

steps:
- checkout

- restore_cache:
key: v1-py3-deps-{{ checksum "setup.py" }}

- run:
name: Create a virtualenv
command: |
mkdir -p /tmp/venv/country_template
python -m venv /tmp/venv/country_template
echo "source /tmp/venv/country_template/bin/activate" >> $BASH_ENV
- run:
name: Install dependencies
command: |
make build
# pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH#egg=OpenFisca-Core[web-api] # use a specific branch of OpenFisca-Core
- save_cache:
key: v1-py3-deps-{{ checksum "setup.py" }}
paths:
- /tmp/venv/country_template

- save_cache:
key: v1-py3-build-{{ .Revision }}
paths:
- dist

- run:
name: Run tests
command: make test

- run:
name: Check version number has been properly updated
command: |
git fetch
.circleci/is-version-number-acceptable.sh
deploy_python3:
deploy:
docker:
- image: python:3.7
environment:
Expand All @@ -143,23 +77,20 @@ jobs:
source /tmp/venv/country_template/bin/activate
twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD
- run:
name: Publish a git tag
command: .circleci/publish-git-tag.sh

workflows:
version: 2
build_and_deploy:
jobs:
- build_python2
- build_python3
- deploy_python2:
requires:
- build_python2
- build_python3
filters:
branches:
only: master
- deploy_python3:
- build
- check_version
- deploy:
requires:
- build_python2
- build_python3
- build
- check_version
filters:
branches:
only: master
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

### 3.6.O - [#66](https://github.com/openfisca/country-template/pull/66)
## 3.7.0 - [#68](https://github.com/openfisca/country-template/pull/68)

* Technical change
* Details:
- Declare package compatible with Core v26
- Remove Python 2 checks from continuous integration

## 3.6.O - [#66](https://github.com/openfisca/country-template/pull/66)

* Minor change
* Details:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name = "OpenFisca-Country-Template",
version = "3.6.0",
version = "3.7.0",
author = "OpenFisca Team",
author_email = "contact@openfisca.org",
classifiers=[
Expand All @@ -23,7 +23,7 @@
("share/openfisca/openfisca-country-template", ["CHANGELOG.md", "LICENSE", "README.md"]),
],
install_requires = [
"OpenFisca-Core[web-api] >= 25.0, < 26.0",
"OpenFisca-Core[web-api] >= 26.0, < 27.0",
],
extras_require = {
"dev": [
Expand Down

0 comments on commit 93a92fe

Please sign in to comment.