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

Make toml an explicit requirement #8626

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

jeffwidman
Copy link
Member

@jeffwidman jeffwidman commented Dec 16, 2023

I couldn't figure out why the tests were failing for:

until I realized that pipfile imports toml:
https://github.com/pypa/pipfile/blob/4706d2cbd35e0b47a05a6421fa17f93827bc454f/setup.py#L44

which then gets used over in the unrelated file parser.py:

project_toml = toml.load(pyproject_path)['project']

So let's make the import of toml explicit so that we aren't relying on the side effects of importing pipfile. The toml requirement from pipfile isn't pinned, so I simply pinned to the latest release.

Python 3.11 added a native tomllib library, so once we drop support for Python 3.10 we can drop this 3p lib entirely.

@jeffwidman jeffwidman requested a review from a team as a code owner December 16, 2023 00:57
@jeffwidman jeffwidman force-pushed the make-toml-import-explicit branch from 005c6e6 to 4abc9e1 Compare December 16, 2023 01:02
@jeffwidman jeffwidman force-pushed the make-toml-import-explicit branch from 4abc9e1 to 110d5b4 Compare December 18, 2023 22:37
@jeffwidman jeffwidman force-pushed the make-toml-import-explicit branch from 110d5b4 to fb42f12 Compare January 23, 2024 00:57
@jeffwidman
Copy link
Member Author

Can I get a review on this? It's good to go.

@jeffwidman jeffwidman force-pushed the make-toml-import-explicit branch 2 times, most recently from 2d0cb4e to 3e40ab1 Compare January 24, 2024 18:37
@jeffwidman
Copy link
Member Author

@deivid-rodriguez @pavera can one of you take a look at this?

To my eyes it's extremely straightforward, so I suspect it just got missed in the Christmas time busyness.

I couldn't figure out why the tests were failing for:
* dependabot#7741

until I realized that `pipfile` imports `toml`:
https://github.com/pypa/pipfile/blob/4706d2cbd35e0b47a05a6421fa17f93827bc454f/setup.py#L44

which then gets used over in the unrelated file `parser.py`:
https://github.com/dependabot/dependabot-core/blob/89ebc55dac8630574301a10917425f80a56e4763/python/helpers/lib/parser.py#L24

So let's make the import of `toml` explicit so that we aren't relying on
the side effects of importing `pipfile`. The `toml` requirement from
`pipfile` isn't pinned, so I simply pinned to the latest release.

Python `3.11` added a native `tomllib` library, so once we drop support
for `3.10` we can drop this 3p lib entirely.
@jeffwidman jeffwidman force-pushed the make-toml-import-explicit branch from 3e40ab1 to f04a6b6 Compare March 11, 2024 16:56
@jeffwidman
Copy link
Member Author

@abdulapopoola this is ready for review...

@abdulapopoola abdulapopoola merged commit 4d467a3 into dependabot:main Mar 14, 2024
44 checks passed
@jeffwidman jeffwidman deleted the make-toml-import-explicit branch March 14, 2024 15:39
@jeffwidman
Copy link
Member Author

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants