Skip to content

support .offset pseudo-op #59

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

Merged
merged 1 commit into from
Aug 7, 2023
Merged

support .offset pseudo-op #59

merged 1 commit into from
Aug 7, 2023

Conversation

jepler
Copy link
Contributor

@jepler jepler commented Aug 5, 2023

Accompanies adafruit/circuitpython#8223 so that a program can include its required offset in the source as a ".offset" directive.

@jepler
Copy link
Contributor Author

jepler commented Aug 5, 2023

@tekktrik the tests are failing in a surprising way. I know you were looking at how tests were run in our workflows, maybe you can make sense of this?

Now, all the tests fail like so:

______________________ ERROR collecting tests/test_mov.py ______________________
ImportError while importing test module '/home/runner/work/Adafruit_CircuitPython_PIOASM/Adafruit_CircuitPython_PIOASM/tests/test_mov.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_mov.py:9: in <module>
    from pytest_helpers import assert_assembles_to, assert_assembly_fails
tests/pytest_helpers.py:11: in <module>
    import adafruit_pioasm
E   ModuleNotFoundError: No module named 'adafruit_pioasm'

It's as though something that would put adafruit_pioasm on the sys.path is not happening. but I don't see any changes anywhere that would affect that.

I do notice the failed run used 3.11 and last successful run 3.9; however, I tried experimentally requesting python 3.9 in the workflow and that didn't make it succeed.

The pytest version was the same in both runs (7.4.0).

I do get the same failure locally if I just run pytest in ~/src/bundle/helpers/pioasm, and it's fixed if I use PYTHONPATH=. pytest. Locally I'm using 3.11.2.

@tekktrik
Copy link
Member

tekktrik commented Aug 5, 2023

I think the code running right now is pytest. This doesn't add the current directory to the path whereas python -m pytest does, which looks to likely be the problem here. Not sure why it would have changed from passing to failing but I do know that the difference between the aforementioned is that path difference.

@jepler
Copy link
Contributor Author

jepler commented Aug 5, 2023

I also notice that pytest fails and python -mpytest succeeds: https://docs.pytest.org/en/7.4.x/explanation/pythonpath.html#invoking-pytest-versus-python-m-pytest

@tekktrik
Copy link
Member

tekktrik commented Aug 5, 2023

I only recently encountered this information! But it does appear to be the issue. A fix to the unified CI should resolve it. I can submit a PR to update it now.

@jepler
Copy link
Contributor Author

jepler commented Aug 6, 2023

The failure should be fixed by

@jepler jepler requested a review from a team August 6, 2023 00:19
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tannewt tannewt merged commit 7ec05cd into adafruit:main Aug 7, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 15, 2023
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.

3 participants