Skip to content

Commit

Permalink
UPDATE DEPENDENCIES: setup.py, py.requirements/*.txt
Browse files Browse the repository at this point in the history
* Update dependencies to newer versions
* tox: Cleanup config-file
* tox: Fix problem w/ python2.7
  - Need to use "pip install --user ..." for now
  - Scripts seem no longer to be installed
  HINT: Seems to be related to virtualenv and macOS 12 Monterey
  SEE: pypa/virtualenv#2284
  • Loading branch information
BaljeetSinghaw authored and jenisys committed Mar 20, 2022
1 parent 1a7df5f commit 1860acc
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 82 deletions.
11 changes: 6 additions & 5 deletions py.requirements/basic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
# * http://www.pip-installer.org/
# ============================================================================

cucumber-tag-expressions >= 1.1.2
cucumber-tag-expressions >= 4.1.0
enum34; python_version < '3.4'
parse >= 1.18.0
parse_type >= 0.4.2
six == 1.15.0
parse_type >= 0.6.0
six >= 1.15.0

traceback2; python_version < '3.0'
contextlib2 # MAYBE: python_version < '3.5'
win_unicode_console >= 0.5; python_version >= '2.7'
contextlib2; python_version < '3.5'
win_unicode_console >= 0.5; python_version < '3.6'
colorama >= 0.3.7

# -- DISABLED PYTHON 2.6 SUPPORT:
Expand Down
17 changes: 8 additions & 9 deletions py.requirements/develop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
# PYTHON PACKAGE REQUIREMENTS FOR: behave -- For development only
# ============================================================================

# -- BUILD-TOOL:
invoke == 1.4.1
pathlib; python_version <= '3.4'
pycmd
# -- BUILD-SYSTEM: invoke
-r invoke.txt

# -- HINT: path.py => path (python-install-package was renamed for python3)
path.py >= 11.5.0; python_version < '3.5'
Expand All @@ -19,9 +17,6 @@ bump2version >= 0.5.6
twine >= 1.13.0

# -- DEVELOPMENT SUPPORT:
tox >= 1.8.1
coverage >= 4.2
pytest-cov

# -- PYTHON2/3 COMPATIBILITY: pypa/modernize
# python-futurize
Expand All @@ -30,7 +25,11 @@ modernize >= 0.5
# -- STATIC CODE ANALYSIS:
pylint

# -- REQUIRES: testing, docs, invoke-task requirements
# -- REQUIRES: testing
-r testing.txt
coverage >= 4.2
pytest-cov
tox >= 1.8.1

# -- REQUIRED FOR: docs
-r docs.txt
-r ../tasks/py.requirements.txt
4 changes: 2 additions & 2 deletions py.requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PyHamcrest < 2.0; python_version < '3.0'
# -- NEEDED: By some tests (as proof of concept)
# NOTE: path.py-10.1 is required for python2.6
# HINT: path.py => path (python-install-package was renamed for python3)
path.py >= 11.5.0,<13.0; python_version < '3.5'
path >= 13.1.0; python_version >= '3.5'
path.py >=11.5.0,<13.0; python_version < '3.5'
path >= 13.1.0; python_version >= '3.5'

-r ../issue.features/py.requirements.txt
48 changes: 31 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*
# -*- coding: UTF-8 -*
"""
Setup script for behave.
Expand Down Expand Up @@ -76,25 +76,32 @@ def find_packages_by_root_package(where):
# SUPPORT: python2.7, python3.3 (or higher)
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*",
install_requires=[
"cucumber-tag-expressions >= 1.1.2",
"cucumber-tag-expressions >= 4.1.0",
"enum34; python_version < '3.4'",
"parse >= 1.18.0",
"parse_type >= 0.4.2",
"six >= 1.12.0",
"parse_type >= 0.6.0",
"six >= 1.15.0",
"traceback2; python_version < '3.0'",
"enum34; python_version < '3.4'",

# -- PREPARED:
"win_unicode_console; python_version < '3.6'",
"colorama",
"contextlib2; python_version < '3.5'",
# DISABLED: "contextlib2 >= 21.6.0; python_version < '3.5'",
"colorama >= 0.3.7",
],
tests_require=[
"pytest < 5.0; python_version < '3.0'", # >= 4.2
"pytest >= 5.0; python_version >= '3.0'",
"pytest-html >= 1.19.0",
"mock >= 1.1",
"PyHamcrest >= 1.9",
"pytest-html >= 1.19.0,<2.0; python_version < '3.0'",
"pytest-html >= 2.0; python_version >= '3.0'",
"mock < 4.0; python_version < '3.6'",
"mock >= 4.0; python_version >= '3.6'",
"PyHamcrest >= 2.0.2; python_version >= '3.0'",
"PyHamcrest < 2.0; python_version < '3.0'",

# -- HINT: path.py => path (python-install-package was renamed for python3)
"path.py >= 11.5.0; python_version < '3.5'",
"path >= 13.1.0; python_version >= '3.5'",
"path >= 13.1.0; python_version >= '3.5'",
"path.py >=11.5.0,<13.0; python_version < '3.5'",
],
cmdclass = {
"behave_test": behave_test,
Expand All @@ -106,12 +113,20 @@ def find_packages_by_root_package(where):
],
"develop": [
"coverage",
"pytest >= 4.2",
"pytest-html >= 1.19.0",
"pytest >=4.2,<5.0; python_version < '3.0' # pytest >= 4.2",
"pytest >= 5.0; python_version >= '3.0'",
"pytest-html >= 1.19.0,<2.0; python_version < '3.0'",
"pytest-html >= 2.0; python_version >= '3.0'",
"mock < 4.0; python_version < '3.6'",
"mock >= 4.0; python_version >= '3.6'",
"PyHamcrest >= 2.0.2; python_version >= '3.0'",
"PyHamcrest < 2.0; python_version < '3.0'",
"pytest-cov",
"tox",
"invoke >= 1.2.0",
"path.py >= 11.5.0",
"invoke >= 1.4.0",
# -- HINT: path.py => path (python-install-package was renamed for python3)
"path >= 13.1.0; python_version >= '3.5'",
"path.py >= 11.5.0; python_version < '3.5'",
"pycmd",
"pathlib; python_version <= '3.4'",
"modernize >= 0.5",
Expand All @@ -121,8 +136,6 @@ def find_packages_by_root_package(where):
"behave-html-formatter",
],
},
# DISABLED: use_2to3= bool(python_version >= 3.0),
# DEPRECATED SINCE: setuptools v58.0.2 (2021-09-06)
license="BSD",
classifiers=[
"Development Status :: 4 - Beta",
Expand All @@ -137,6 +150,7 @@ def find_packages_by_root_package(where):
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: Jython",
"Programming Language :: Python :: Implementation :: PyPy",
Expand Down
77 changes: 28 additions & 49 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,65 +1,24 @@
# ============================================================================
# TOX CONFIGURATION: behave
# ============================================================================
# REQUIRES: pip install tox
# DESCRIPTION:
#
# Use tox to run tasks (tests, ...) in a clean virtual environment.
# Afterwards you can run tox in offline mode, like:
#
# tox -e py38
#
# Tox can be configured for offline usage.
# Initialize local workspace once (download packages, create PyPI index):
#
# tox -e init1
# tox -e init2 (alternative)
#
# NOTE:
# You can either use "local1" or "local2" as local "tox.indexserver.default":
#
# * $HOME/.pip/downloads/ (local1, default)
# * downloads/ (local2, alternative)
# USAGE:
# tox -e py39 #< Run tests with python3.9
# tox -e py27 #< Run tests with python2.7
#
# SEE ALSO:
# * http://tox.testrun.org/latest/config.html
# * https://tox.wiki/en/latest/config.html
# ============================================================================
# envlist = py310, py39, py38, py27, py37, py36, py35, pypy3, pypy, docs
# -- ONLINE USAGE:
# PIP_INDEX_URL = http://pypi.org/simple

[tox]
minversion = 2.3
envlist = py310, py39, py27, py38, py37, py36, py35, pypy3, pypy, docs
skip_missing_interpreters = True
sitepackages = False
indexserver =
default = https://pypi.org/simple
default2 = file://{homedir}/.pip/downloads/simple
local1 = file://{toxinidir}/downloads/simple
local2 = file://{homedir}/.pip/downloads/simple
pypi = https://pypi.org/simple

# -----------------------------------------------------------------------------
# TOX PREPARE/BOOTSTRAP: Initialize local workspace for tox off-line usage
# -----------------------------------------------------------------------------
[testenv:init1]
changedir = {toxinidir}
skipsdist = True
commands=
{toxinidir}/bin/toxcmd.py mkdir {toxinidir}/downloads
pip download --dest={toxinidir}/downloads -r py.requirements/all.txt
{toxinidir}/bin/make_localpi.py {toxinidir}/downloads
deps=

envlist = py39, py27, py310, py38, pypy3, pypy, docs
skip_missing_interpreters = true

[testenv:init2]
changedir = {toxinidir}
skipsdist = True
commands=
{toxinidir}/bin/toxcmd.py mkdir {homedir}/.pip/downloads
pip download --dest={homedir}/.pip/downloads -r py.requirements/all.txt
{toxinidir}/bin/make_localpi.py {homedir}/.pip/downloads
deps=

# -----------------------------------------------------------------------------
# TEST ENVIRONMENTS:
Expand All @@ -77,9 +36,28 @@ setenv =
PYTHONPATH = {toxinidir}


# -- HINT: Script(s) seems to be no longer installed on Python 2.7.
# WEIRD: pip-install seems to need "--user" option.
# RELATED: https://github.com/pypa/virtualenv/issues/2284 -- macOS 12 Monterey related
[testenv:py27]
# MAYBE: platform = darwin
install_command = pip install --user -U {opts} {packages}
changedir = {toxinidir}
commands=
python -m pytest {posargs:tests}
python -m behave --format=progress {posargs:features}
python -m behave --format=progress {posargs:tools/test-features}
python -m behave --format=progress {posargs:issue.features}
deps=
{[testenv]deps}
setenv =
PYTHONPATH = {toxinidir}


[testenv:docs]
changedir = docs
commands = sphinx-build -W -b html -D language=en -d {toxinidir}/build/docs/doctrees . {toxinidir}/build/docs/html/en
commands =
sphinx-build -W -b html -D language=en -d {toxinidir}/build/docs/doctrees . {toxinidir}/build/docs/html/en
deps = -r{toxinidir}/py.requirements/docs.txt


Expand Down Expand Up @@ -128,6 +106,7 @@ deps=
setenv =
PYTHONPATH = .:{envdir}


# ---------------------------------------------------------------------------
# SELDOM-USED: OPTIONAL TEST ENVIRONMENTS:
# ---------------------------------------------------------------------------
Expand Down

0 comments on commit 1860acc

Please sign in to comment.