Fix the Pipfile + setup.py tests
Apparently testing to import the package will work no matter what as we
will find it locally so setup.py may not need to run. By adding a small
dependency I could check if the dependency is installed and now the
tests actually tests what they should.
MODIFY
tests/venv/pipfile/setup-py-explicit/setup.py
tests/venv/pipfile/setup-py-explicit/setup.py
@@ -8,5 +8,5 @@ setup(
author_email='dummy@my-email.com',
description='Dummy package for testing purposes only',
packages=find_packages(),
- install_requires=['numpy'],
+ install_requires=['pypi-pkg-test==0.0.4'],
)

MODIFY
tests/venv/pipfile/setup-py-explicit/verify
tests/venv/pipfile/setup-py-explicit/verify
#!/usr/bin/env python
import there
import dummy
+
+# This package should be available, as it was a dependency for dummy
+import pypi_pkg_test

MODIFY
tests/venv/pipfile/setup-py-implicit/setup.py
tests/venv/pipfile/setup-py-implicit/setup.py
@@ -8,5 +8,5 @@ setup(
author_email='dummy@my-email.com',
description='Dummy package for testing purposes only',
packages=find_packages(),
- install_requires=['numpy'],
+ install_requires=['pypi-pkg-test==0.0.4'],
)

MODIFY
tests/venv/pipfile/setup-py-implicit/verify
tests/venv/pipfile/setup-py-implicit/verify
@@ -3,7 +3,9 @@ import there
try:
import dummy
+ import pypi_pkg_test
except ImportError:
+ # We want an ImportError to be thrown for this test to pass
pass
else:
- raise Exception("'dummy' shouldn't have been installed from setup.py when a Pipfile was present")
+ raise Exception("'dummy' and its dependency 'pypi_pkg_test' shouldn't have been installed! A Pipfile was present without explicit instructions to install the local package 'dummy'.")

Fix the Pipfile + setup.py tests

Apparently testing to import the package will work no matter what as we
will find it locally so setup.py may not need to run. By adding a small
dependency I could check if the dependency is installed and now the
tests actually tests what they should.