Skip to content

Commit da927a0

Browse files
committed
install setuptools for test packages, use pip
* setuptools isn't included in ensurepip in Python 3.12 * Use pip install instead of invoking setup.py directly, due to setuptools discouraging it and allowing updates for the tests packages to use PEP517 compliant build system to done seamlessly. Also don't need to invoke pip install -r requirements.txt. * editable_mode=compat is comparable to python setup.py develop. But setuptools doesn't guarantee the longevity of the feature. Removal of support for the legacy method would be a thing consider. Signed-off-by: Alfred Wingate <[email protected]>
1 parent 05ccf75 commit da927a0

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

tests/test_cp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test_new_env_activated () {
2323
mkvirtualenv "source" >/dev/null 2>&1
2424
RC=$?
2525
assertEquals "0" "$RC"
26-
(cd tests/testpackage && python setup.py install) >/dev/null 2>&1
26+
(cd tests/testpackage && pip install .) >/dev/null 2>&1
2727
cpvirtualenv "source" "destination" >/dev/null 2>&1
2828
rmvirtualenv "source" >/dev/null 2>&1
2929
testscript="$(which testscript.py)"

tests/test_project_templates.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test_dir=$(dirname $0)
44
source "$test_dir/setup.sh"
55

66
oneTimeSetUp() {
7-
(cd "$test_dir/testtemplate" && rm -rf build && "$VIRTUAL_ENV/bin/python" setup.py install)
7+
(cd "$test_dir/testtemplate" && rm -rf build && "$VIRTUAL_ENV/bin/python" -m pip install .)
88
rm -rf "$WORKON_HOME"
99
mkdir -p "$WORKON_HOME"
1010
rm -rf "$PROJECT_HOME"

tests/test_wipeenv.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ tearDown() {
2020

2121
test_wipeenv () {
2222
mkvirtualenv "wipetest" >/dev/null 2>&1
23-
(cd tests/testpackage && python setup.py install) >/dev/null 2>&1
23+
(cd tests/testpackage && pip install .) >/dev/null 2>&1
2424
before="$(pip freeze)"
2525
assertTrue "testpackage not installed" "pip freeze | grep testpackage"
2626
wipeenv >/dev/null 2>&1
@@ -52,7 +52,7 @@ test_wipeenv_pip_e () {
5252

5353
test_wipeenv_develop () {
5454
mkvirtualenv "wipetest" >/dev/null 2>&1
55-
(cd tests/testpackage && python setup.py develop) >/dev/null 2>&1
55+
(cd tests/testpackage && pip install -e . --config-settings editable_mode=compat) >/dev/null 2>&1
5656
before="$(pip freeze)"
5757
assertTrue "testpackage not installed" "pip freeze | grep testpackage"
5858
wipeenv >/dev/null 2>&1

tests/testpackage/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
setuptools

tests/testtemplate/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
setuptools

0 commit comments

Comments
 (0)