Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Madoshakalaka committed Nov 17, 2019
2 parents 889dd2d + c6a341a commit e95a0f7
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 68 deletions.
7 changes: 0 additions & 7 deletions .idea/dictionaries/Matt.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/dictionaries/matt.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 34 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ language: python
dist: xenial

# only intended for Linux python3 jobs.
install: python3 -m pip install tox-travis
# only intended for Linux python3 jobs.
# Windows and MacOS will overwrite (Partly as tox-travis does not work on these two platforms)
# https://github.com/tox-dev/tox-travis/issues/133
script: python3 -m tox
# Linux Python2.7 job, Windows jobs, and Mac jobs will overwrite
install: python3 -m pip install .[dev]


before_cache:
Expand All @@ -16,13 +13,18 @@ jobs:
include:
# linux
- python: '3.8'
script: python3 -m tox -e py38
- python: '3.7'
script: python3 -m tox -e py37
- python: '3.6.9'
script: python3 -m tox -e py36
- python: '3.5'
script: python3 -m tox -e py35
- python: '3.4.8'
script: python3 -m tox -e py34
- python: '2.7.17'
install: 'python -m pip install tox-travis'
script: 'python -m tox'
install: python -m pip install .[dev]
script: python -m tox -e py27

# osx python 3.8
- name: "Python: 3.8"
Expand All @@ -40,8 +42,9 @@ jobs:
before_install:
- pyenv install 3.8-dev
- pyenv global 3.8-dev
install: python3 -m pip install --user tox-travis
- export PATH="/Users/travis/.pyenv/shims:${PATH}"
# end switch
install: python3 -m pip install --user .[dev]
script: python3 -m tox -e py38

# osx python 3.7
Expand All @@ -51,9 +54,7 @@ jobs:
osx_image: xcode11
# language: python will error
language: shell
before_script: python3 --version
# weird permission error without --user
install: python3 -m pip install --user tox-travis
install: python3 -m pip install --user .[dev]
script: python3 -m tox -e py37

# osx python 3.6.5
Expand All @@ -62,7 +63,7 @@ jobs:
osx_image: xcode9.4 # Python 3.6.5 running on macOS 10.13
before_script: python3 --version
language: shell
install: python3 -m pip install --user tox-travis
install: python3 -m pip install --user .[dev]
script: python3 -m tox -e py36

# osx python 3.5
Expand All @@ -81,8 +82,12 @@ jobs:
before_install:
- pyenv install 3.5.2
- pyenv global 3.5.2
install: python3 -m pip install --user tox-travis
- export PATH="/Users/travis/.pyenv/shims:${PATH}"
- python3 -m pip install --user --upgrade pip
- python3 -m pip install --user --upgrade setuptools
# end switch
install: python3 -m pip install --user .[dev]
# for some reason tox cannot find python3.5. we have to use py instead of py35
script: python3 -m tox -e py35

# osx python 3.4
Expand All @@ -101,19 +106,23 @@ jobs:
before_install:
- pyenv install 3.4.5
- pyenv global 3.4.5
install: python3 -m pip install --user tox-travis
- export PATH="/Users/travis/.pyenv/shims:${PATH}"
- python3 -m pip install --user pip==19.1 # highest pip support for python 3.4 is 19.1
- python3 -m pip install --user --upgrade setuptools
# end switch
install: python3 -m pip install --user .[dev]
script: python3 -m tox -e py34

# osx python 2.7.14
- name: "Python: 2.7.14"
os: osx
osx_image: xcode9.3 # Python 2.7.14_2 running on macOS 10.13
language: shell
install: python -m pip install --user tox-travis
before_install:
- python -m pip install --user --upgrade pip
- python -m pip install --user --upgrade setuptools
install: python -m pip install --user .[dev]
script: python -m tox -e py27
# end switch
before_script: python3 --version

# windows python 3.8
- name: "Python: 3.8"
Expand All @@ -124,7 +133,7 @@ jobs:
before_install:
- choco install python --version 3.8.0
- python -m pip install --upgrade pip
install: python -m pip install tox-travis
install: python -m pip install --user .[dev]
# On Windows, python3 does not exist
script: python -m tox -e py38
env: PATH=/c/Python38:/c/Python38/Scripts:$PATH
Expand All @@ -138,7 +147,7 @@ jobs:
before_install:
- choco install python --version 3.7.4
- python -m pip install --upgrade pip
install: python -m pip install tox-travis
install: python -m pip install --user .[dev]
# On Windows, python3 does not exist
script: python -m tox -e py37
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
Expand All @@ -150,7 +159,7 @@ jobs:
before_install:
- choco install python --version 3.6.8
- python -m pip install --upgrade pip
install: python -m pip install tox-travis
install: python -m pip install --user .[dev]
script: python -m tox -e py36
env: PATH=/c/Python36:/c/Python36/Scripts:$PATH

Expand All @@ -161,7 +170,7 @@ jobs:
before_install:
- choco install python --version 3.5.4
- python -m pip install --upgrade pip
install: python -m pip install tox-travis
install: python -m pip install --user .[dev]
script: python -m tox -e py35
env: PATH=/c/Python35:/c/Python35/Scripts:$PATH

Expand All @@ -171,8 +180,9 @@ jobs:
language: shell
before_install:
- choco install python --version 3.4.4.20180111
- python -m pip install --upgrade pip
install: python -m pip install tox-travis
- python -m pip install pip==19.1
- python -m pip install --upgrade setuptools # old setuptools does not recognize a bunch of keyword arguments in setup.py
install: python -m pip install --user .[dev]
script: python -m tox -e py34
env: PATH=/c/Python34:/c/Python34/Scripts:$PATH

Expand All @@ -183,6 +193,6 @@ jobs:
before_install:
- choco install python2
- python -m pip install --upgrade pip
install: python -m pip install tox-travis
install: python -m pip install --user .[dev]
script: python -m tox -e py27
env: PATH=/c/Python27:/c/Python27/Scripts:$PATH
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ Please use package entry instead: `python3 -m pipenv_setup sync --dev --pipfile`

# Tests

`$ pytest` runs all the tests with your python version
`$ pytest` runs tests with your python version

Optionally, if you have some of python 2.7/3.4/3.5/3.6/3.7/3.8 installed

`$ tox` will run tests on at most 6 python versions depending how many versions you installed on your machine

Specify `$ tox -e pyXX` to run tests with specific python version
Specify `$ tox -e pyXX` to run tests with specific python version. It's worth noting `py37` is the major test environment
and has extra `mypy` tests for static type checking (if type hints are used in code). For lightweight tests, it's a good
choice is to at least have python3.7 and use `$ tox -e py37` instead of `$ pytest`

In this project, dev dependencies in Pipfile should be synced to `setup.py` in `extras_require`, as tox installs
`pipenv-setup[dev]` before running tests.
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include README.md
include README.md
include LICENSE
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pytest-datadir = "~=1.3"
codecov = {markers = "python_version>='3.6'",version = "~=2.0"}
pytest-xdist = "~=1.29"
tox = "~=3.14"
tox-travis = "~=0.12"
autopep8 = "~=1.4"

[packages]
Expand All @@ -24,6 +23,7 @@ requirementslib = "~=1.5"
vistir = "~=0.4"
autopep8 = {markers = "python_version<'3.6'",version = "~=1.4"}
six = "~=1.12"
typing = "~=3.7"

[scripts]
# use this to sync this pipfile to setup.py, explained in CONTRIBUTING.md
Expand Down
28 changes: 19 additions & 9 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion pipenv_setup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
import argparse
import sys
from sys import stderr
from typing import List, Union, NoReturn, Iterable, Text
from typing import List, Union, Iterable, Text

try:
# Seems like NoReturn is not backported properly in python 3.5
# build failure
# https://travis-ci.org/Madoshakalaka/pipenv-setup/jobs/613058915?utm_medium=notification&utm_source=github_status
from typing import NoReturn
except ImportError:
pass

from six import string_types

Expand Down
8 changes: 5 additions & 3 deletions pipenv_setup/msg_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
All kinds of messages pipenv-setup prints to console
"""

from vistir.compat import Path
from colorama import Fore
from vistir.compat import Path


def colorful_help():
Expand Down Expand Up @@ -54,7 +54,8 @@ def generate_success(
src = "Pipfile" if pipfile else "Pipfile.lock"
string = (
"setup.py was successfully generated"
"\n%d default packages synced from %s to setup.py" % (default_package_count, src)
"\n%d default packages synced from %s to setup.py"
% (default_package_count, src)
)

if dev_package_count != 0:
Expand All @@ -66,6 +67,7 @@ def generate_success(
string += "\nPlease edit the required fields in the generated file"
return string


def update_success(
default_package_count, dev_package_count=0, pipfile=False
): # type: (int, int, bool) -> str
Expand All @@ -83,7 +85,7 @@ def update_success(

if dev_package_count != 0:
string += "\n%d dev packages from %s synced to setup.py" % (
default_package_count,
dev_package_count,
src,
)
return string
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
# And include any *.msg files found in the 'hello' package, too:
"pipenv_setup": ["res/*"]
},
data_files=[("", ["LICENSE"])],
packages=find_packages(exclude=["tests", "docs"]), # Required
# Specify which Python versions you support. In contrast to the
# 'Programming Language' classifiers above, 'pip install' will check this
Expand All @@ -145,7 +144,6 @@
"codecov~=2.0; python_version >= '3.6'",
"pytest-xdist~=1.29",
"tox~=3.14",
"tox-travis~=0.12",
"autopep8~=1.4",
]
},
Expand All @@ -158,6 +156,7 @@
"vistir~=0.4",
"autopep8~=1.4; python_version < '3.6'",
"six~=1.12",
"typing~=3.7",
], # Optional
entry_points={
"console_scripts": ["pipenv-setup=pipenv_setup.main:cmd"]
Expand Down
10 changes: 2 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@
envlist = py27, py34, py35, py36, py37, py38
skip_missing_interpreters=true


[testenv]
passenv =
CODECOV_*
extras = dev
; installed via setup[dev]
whitelist_externals =
pytest
codecov
passenv =
CI
TRAVIS
TRAVIS_*
TOXENV
CODECOV_*

commands =
pytest --cov=pipenv_setup {posargs}


[testenv:py34]
; pytest 5 doesn't exist
deps =
Expand Down

0 comments on commit e95a0f7

Please sign in to comment.