Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing: fixture to temporarily add certain utilities to binary path #303

Closed
itsayellow opened this issue Dec 27, 2019 · 2 comments · Fixed by #930
Closed

Testing: fixture to temporarily add certain utilities to binary path #303

itsayellow opened this issue Dec 27, 2019 · 2 comments · Fixed by #930

Comments

@itsayellow
Copy link
Contributor

itsayellow commented Dec 27, 2019

How would this feature be useful?

Currently, with a package that requires compilation, tests that install it fail on macOS (such as regex dependency inside of black).

Additionally, it would be helpful to add git and other VCS tools so that we could test installing package specifications with VCS urls.

Describe the solution you'd like

The solution that @chrahunt mentioned (#298 (comment)), quoted below:

  1. Have a session-scoped fixture which creates a temporary directory
  2. Populate the directory with symlinks to whitelisted build tools identified by shutil.which like gcc/clang
  3. Depend on that fixture here, adding the temporary directory to PATH

Describe alternatives you've considered
Previously, we just added some paths to the bin path (see PR #269 to fix Issue #266) but this resulted in undesired side-effects and was removed (#298, #299 )

@itsayellow
Copy link
Contributor Author

The trick would be how best to make this work on Windows, with no symlinks, and without requiring pywin32 as a new dependency (e.g. to make windows shortcuts). A cheap way might be *.bat files?

@itsayellow
Copy link
Contributor Author

Adding a note here that the reason we don't have access to the normal system path, is that currently tests/conftest.py removes all paths from the system PATH except the pipx app bin path, with the following line:

    monkeypatch.setenv("PATH", str(bin_dir))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant