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

1.9: several issues with what is installed #411

Open
kloczek opened this issue May 22, 2022 · 5 comments
Open

1.9: several issues with what is installed #411

kloczek opened this issue May 22, 2022 · 5 comments

Comments

@kloczek
Copy link

kloczek commented May 22, 2022

Looks like examples, pygraphviz/tests and INSTALL.txt are installed.
Part of the problems with pytest is installing pygraphviz/tests which creates kind of conditions to pass pytest.
I just found that in fedora spec file as workround to pass tests has been used hack to pass path to installed resources

%check
pytest -v %{buildroot}%{python3_sitearch}/pygraphviz/tests/
@rossbar
Copy link
Contributor

rossbar commented May 30, 2022

I don't understand the issue, would you mind expanding on the OP a bit? Installing with the test suite is intentional (AFAIK) so that the installation is testable after install. This is particularly important for pygraphviz since it currently builds/links against the local graphviz installation. The standard way to run the test suite for the installed pygraphviz would be something like pytest --pyargs pygraphviz in whichever environment pygraphviz is installed, but it doesn't sound like this is the issue...

@kloczek
Copy link
Author

kloczek commented May 30, 2022

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Please check what is in generated .whl file and testing using above methodology.
If testing requires --pyargs pygraphviz that should be added in pytest.ini.

@rossbar
Copy link
Contributor

rossbar commented May 30, 2022

If testing requires --pyargs pygraphviz that should be added in pytest.ini.

I'm not sure what would be added to the config file... pytest --pyargs is the canonical incantation for running the test suite on installed libraries. I'm not a pytest expert though, so if there's a specific chunk of pytest documentation that you base your workflow on, please link it here so we can take a look!

@rossbar
Copy link
Contributor

rossbar commented May 31, 2022

I'm -0.5 on making --pyargs a default flag for pytest as I feel this has the potential to introduce complications for the development workflow. For example, if a developer is using pip install . without the developer/editable mode, then modifying this flag may subtly change the behavior of pytest in their dev env. Then again, I'm clearly biased towards developers ;) - if others prefer modifying the defaults I don't feel very strongly about it!

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

No branches or pull requests

2 participants