Skip to content

Add working_directory for subsequent code file #10263

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 3 commits into from
Apr 22, 2025

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Apr 16, 2025

This allows subfolders to be treated similar to / for multiple apps within different folders.

Also, fix up the internal current working directory so it doesn't depend on volumes.

Fixes #9045 and fixes #8409.

@tannewt
Copy link
Member Author

tannewt commented Apr 17, 2025

Hopefully #10269 will make enough space for this.

This allows subfolders to be treated similar to / for multiple
apps within different folders.

Also, fix up the internal current working directory so it doesn't
depend on volumes.

Fixes micropython#9045 and fixes micropython#8409.
@tannewt tannewt force-pushed the next_code_working_dir branch from ca1199b to 3377765 Compare April 22, 2025 16:59
@tannewt tannewt marked this pull request as ready for review April 22, 2025 19:15
@tannewt tannewt requested a review from dhalbert April 22, 2025 19:15
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Interesting that the .. normalization was done for LFS here: micropython@d3ea28d. Too bad it's not in a general place.

I don't see any issues, but I think you could write some tests for this with a toy filesystem as is done in some other MicroPython tests. There are a lot of edge cases here. Not asking you to do this now, but it would be worth it when writing similar kind of code in the future.

Thanks!

@tannewt tannewt merged commit 492f6e9 into adafruit:main Apr 22, 2025
615 checks passed
@tannewt
Copy link
Member Author

tannewt commented Apr 22, 2025

I think it'd be good for us to setup some C level unit tests. There's no reason to run it through the Python VM.

The unix port is more MicroPython than CircuitPython, which makes it hard too.

dhalbert pushed a commit that referenced this pull request Apr 28, 2025
PR #10263 moved it to only before code.py. This breaks the repl (and
likely boot.py.)

Fixes #10289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants