Skip to content

Commit

Permalink
WIP: fixed python 2 version not being deployed to pypi (#6)
Browse files Browse the repository at this point in the history
* WIP: Added type hints, still waiting on resolution of [so issue](https://stackoverflow.com/q/54425358/4200103).

* Added nox, updated travis.yml

* Added script to remove type-hints for all python versions below 3.6

* forgot to add test-requirements.txt

* removed 2.6 support

* - moved testing for different python versions from travis to nox
- added auto stripping of type hints

* decided to keep support for 2.6 until we need a lib that does not support it

* forgot to delete something from travis.yml

* fixed travis.yml for name of pytests method inside nox file

* moved type hints to .pyi stubs on deploy to prevent python version compatibility issues

* added deployment for other python versions
  • Loading branch information
Anton-4 authored and PaulSchweizer committed Feb 13, 2019
1 parent 54fbbb2 commit b1cee39
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
28 changes: 22 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
language: python
python:
- '2.6'
- '2.7'
- '3.4'
- '3.5'
- '3.6'
- '3.7'
install:
- python setup.py install
- pip install mypy
- pip install strip-hints
- pip install -r test-requirements.txt
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6"]]; then
pip install mypy
pip install strip-hints
pip install nox
fi
jobs:
include:
- stage: test
name: static_type
script: nox -s static_type
if: "$TRAVIS_PYTHON_VERSION" = "3.6"
- stage: test
name: pytests_with_hints
script: nox -s pytests_with_hints
if: "$TRAVIS_PYTHON_VERSION" = "3.6"
- stage: test
name: pytests_no_hints
script: nox -s pytests_no_hints
if: "$TRAVIS_PYTHON_VERSION" = "3.6"
- stage: test
name: coverage
script: coverage run --source ascii_canvas -m pytest ./tests --cov=ascii_canvas --cov-report=xml
--cov-report=term
--cov-report=term
if: "$TRAVIS_PYTHON_VERSION" = "3.6"

after_success:
- python-codacy-coverage -r coverage.xml
- stubgen ascii_canvas --recursive -o .
- python strip-type-hints.py
before_deploy:
if ! [[ "$TRAVIS_PYTHON_VERSION" IN ("2.6", "2.7", "3.4", "3.5")]]; then
stubgen ascii_canvas --recursive -o .
python strip-type-hints.py
else
stubgen ascii_canvas --recursive -o .
fi
deploy:
provider: pypi
skip_existing: true
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
long_description = stream.read()

setup(name='ascii-canvas',
version='1.2.3',
version='1.2.4',
author='Paul Schweizer',
author_email='paulschweizer@gmx.net',
description='Treat strings like Items on a 2D Canvas.',
Expand All @@ -21,5 +21,5 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
'Programming Language :: Python :: 3.7',
])

0 comments on commit b1cee39

Please sign in to comment.