Skip to content

Commit

Permalink
Use mxdev in tox.
Browse files Browse the repository at this point in the history
With standard pip, we cannot both install ourselves in editable mode *and* use a constraints file that has a pin for our package.
With mxdev, we ignore this single pin.
See plone/Products.CMFPlone#3859 (comment)
  • Loading branch information
mauritsvanrees committed Oct 19, 2023
1 parent ad84ee4 commit 051e131
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions mx.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[settings]
ignores =
plone.app.multilingual
main-package = -e .[test]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-c https://dist.plone.org/release/6.1-dev/constraints.txt
19 changes: 11 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ commands =

[testenv:test]
description = run the distribution tests
use_develop = true
skip_install = false
constrain_package_deps = true
set_env =
ROBOT_BROWSER=headlesschrome

Expand All @@ -88,13 +85,17 @@ set_env =
# """
##
deps =
mxdev
zope.testrunner
-c https://dist.plone.org/release/6.1-dev/constraints.txt
##
# Specify a custom constraints file in .meta.toml:
# [tox]
# constraints_file = "https://my-server.com/constraints.txt"
##
commands_pre =
mxdev -c mx.ini
pip install -rrequirements-mxdev.txt
commands =
zope-testrunner --all --test-path={toxinidir}/src -s plone.app.multilingual {posargs}
extras =
Expand All @@ -111,9 +112,6 @@ extras =

[testenv:coverage]
description = get a test coverage report
use_develop = true
skip_install = false
constrain_package_deps = true
set_env =
ROBOT_BROWSER=headlesschrome

Expand All @@ -128,6 +126,9 @@ deps =
coverage
zope.testrunner
-c https://dist.plone.org/release/6.1-dev/constraints.txt
commands_pre =
mxdev -c mx.ini
pip install -rrequirements-mxdev.txt
commands =
coverage run --branch --source plone.app.multilingual {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.app.multilingual {posargs}
coverage report -m --format markdown
Expand All @@ -154,8 +155,6 @@ commands =

[testenv:circular]
description = ensure there are no cyclic dependencies
use_develop = true
skip_install = false
set_env =

##
Expand All @@ -168,9 +167,13 @@ set_env =
allowlist_externals =
sh
deps =
mxdev
pipdeptree
pipforester
-c https://dist.plone.org/release/6.1-dev/constraints.txt
commands_pre =
mxdev -c mx.ini
pip install -rrequirements-mxdev.txt
commands =
# Generate the full dependency tree
sh -c 'pipdeptree -j > forest.json'
Expand Down

0 comments on commit 051e131

Please sign in to comment.