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

test: add our own src/ directory to the search path #153

Closed

Conversation

BrunoMSantos
Copy link
Collaborator

So I finally got around to try and package the newest version for Arch and discovered I couldn't run the tests with a simple make test.

No idea just yet if this will break the CI. Not sure why / how it's running in CI either, though I confess I haven't looked too hard into it. Either way, I am positive that make test was trying to run my old system installation of hawkmoth and this fixes it for me.

Not so related, and not sure if you had already commented on that, but sphinx-testing is now properly deprecated. I'm currently running an unmaintained version. We're probably on borrowed time here and we'll have to convert to the built in sphinx.testing soon :/

As an artefact of the recent move of the module into the src/ folder,
the unit tests cannot find the local package anylonger. Worse still,
with a sufficiently compatible version of hawkmoth available in the
system path, we may be duped into thinking the tests are working when
they aren't.
@jnikula
Copy link
Owner

jnikula commented Apr 21, 2023

So I finally got around to try and package the newest version for Arch and discovered I couldn't run the tests with a simple make test.

No idea just yet if this will break the CI. Not sure why / how it's running in CI either, though I confess I haven't looked too hard into it. Either way, I am positive that make test was trying to run my old system installation of hawkmoth and this fixes it for me.

What you need to do is in venv:

pip install --config-settings editable_mode=strict --editable .

That installs hawkmoth in the virtual environment in editable mode using setup.py (effectively setup.cfg but editable installs don't support that directly).

This means testing hawkmoth as it is installed, not directly from Python path. And one of the main points of the whole src/ subdirectory is to avoid using it from Python path, which contains the current directory.

This helps catch the kind of embarrassing packaging mistakes I made with v0.13.

So I'm rejecting this one.

Not so related, and not sure if you had already commented on that, but sphinx-testing is now properly deprecated. I'm currently running an unmaintained version. We're probably on borrowed time here and we'll have to convert to the built in sphinx.testing soon :/

Meh. I've looked at it several times, and it's not a simple conversion.

@BrunoMSantos
Copy link
Collaborator Author

Hmm, I thought that was meant to be covered by CI but that we would still support an easy and quick way of testing without it locally. Though I guess this would have to be done differently even then.

To tell the truth, I stay away from venvs as much as possible. But I guess it's easy enough to carry around a workaround on my side for now so I'll do that.

Meh. I've looked at it several times, and it's not a simple conversion.

Yup, got the same impression :/

@BrunoMSantos BrunoMSantos deleted the fix-test-import-paths branch October 28, 2023 21:24
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 this pull request may close these issues.

2 participants