Skip to content

Add check for packaging information #23

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 7 commits into from
Jul 28, 2023
Merged

Conversation

tekktrik
Copy link
Member

@tekktrik tekktrik commented May 31, 2023

Implements fix created by adafruit/actions-ci-circuitpython-libs#19

@tekktrik tekktrik linked an issue May 31, 2023 that may be closed by this pull request
@tekktrik tekktrik requested a review from a team May 31, 2023 22:47
@tekktrik
Copy link
Member Author

@FoamyGuy this is the preventative fix for the issue you encountered!

Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

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

while looking at #23 I realized that this is related to an issue I saw while building documentation: for RTD, I think that docs/requirements.txt is used. However, this CI uses the top-level requirements.txt only.

Here's the command used by RTD:

python -m pip install --exists-action=w --no-cache-dir -r docs/requirements.txt 

For the purposes of jepler_udecimal I have listed sphinx-autoapi in optional-requirements.txt as well as docs/requirements.txt, but #23 will switch the "optional" deps to install only when pytest is used. This won't affect jepler_udecimal since it does happen to contain pytest tests.

In particular, this means that essentially all of the docs built during CI will be broken, because sphinxcontrib-jquery won't be installed...

another alternative is to drop doc building from github actions and widely enable this instead: Preview documentation from pull requests

@tekktrik
Copy link
Member Author

tekktrik commented Jun 1, 2023

I think the documentation preview is interesting but may take some time to implement since I think every library, as it's own project, would need this enabled, and make sure it's enabled for new projects too. @kattni, what are your thoughts?

I think the intention for "optional dependencies" was for either opt-in behavior (e.g., using PIL on CPython/Blinka libraries) or things used in examples (e.g., something like a Python library for interacting with Discord). In this case, I think it's worth having an unconditional install of docs/requirements.txt added and keep the installation of truly "optional" dependencies separate. Does that sound like a good solution? I agree have docs built correctly is important, even in the build CI.

@tekktrik
Copy link
Member Author

@jepler is this all set for review? Please let me know if I haven't addressed anything from your last comment!

@jepler
Copy link
Contributor

jepler commented Jul 25, 2023

I think I need to explain again the problem I see:

In practice, the optional_requirements.txt file is used to install dependencies used during the CI documentation-building step that occurs on github (even though the result of that is never used). I noticed this in jepler_udecimal but this is also seen in nunchuk within the standard bundle according to a search. I didn't check the community bundle.

But after the CI changes here, optional_requirements.txt is only used if there are tests, which means that a library that doesn't have tests, but has docs with dependencies in optional_requirements.txt will fail to build, I think.

@tekktrik
Copy link
Member Author

I actually noticed (and fixed) in #29 the fact that the pip installations here were entirely redundant, and confirmed it by checking the CI. They actually get installed beforehand via https://github.com/adafruit/actions-ci-circuitpython-libs/blob/820e76313197a5721a966d7bd3cfc70ad8156a61/install.sh#L23-L26 so that line would also be redundant now. I believe I understand what you're saying now, but I think this means nothing should break for now.

Relatedly, it may be necessary to patch the libraries to add optional_requirements.txt to .readthedocs.yaml then, based on what you're saying.

@tekktrik
Copy link
Member Author

Changes made, I can bring up the patch idea this Monday at the weekly meeting! Pinging @kattni in advance in case we need to go that route.

Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

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

thanks for clearing that up, I appreciate it.

@tekktrik tekktrik merged commit 4ee6c23 into adafruit:main Jul 28, 2023
@tekktrik
Copy link
Member Author

Thanks for helping me out with this!

@tekktrik tekktrik deleted the dev/pkg-check branch July 28, 2023 01:17
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.

Check if pyproject.toml defines library correctly
2 participants