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

Modernize metadata #4341

Merged
merged 3 commits into from Sep 18, 2022
Merged

Modernize metadata #4341

merged 3 commits into from Sep 18, 2022

Conversation

ofek
Copy link
Sponsor Collaborator

@ofek ofek commented Sep 11, 2022

This fixes #4337 (comment) by implementing the workaround that other large projects have chosen after removing their setup.py:

@ofek ofek mentioned this pull request Sep 11, 2022
@ofek
Copy link
Sponsor Collaborator Author

ofek commented Sep 11, 2022

The "Used By" will repopulate within a few days

@squidfunk
Copy link
Owner

Okay, great, thanks! I'll revisit this PR after the blog plugin is out and the dust has settled. Doing two things at once often doesn't pan out great 😉

@ofek
Copy link
Sponsor Collaborator Author

ofek commented Sep 11, 2022

Cool! Is blogging public or insiders?

@squidfunk
Copy link
Owner

The blog plugin will be first released in Insiders, exclusively to sponsors. It's the biggest release this year and it's a great feature to convince more users to support the project by funding it to help make it even better 😊

@ofek
Copy link
Sponsor Collaborator Author

ofek commented Sep 11, 2022

"Used By" is back already fyi

the biggest release this year and it's a great feature

Yup this will be the first time I'll be forced to stop being lazy and set up Insiders! I've just been sponsoring and waiting for many things.

@squidfunk
Copy link
Owner

squidfunk commented Sep 11, 2022

Ah, hehe, thanks for sponsoring anyway then! I think you'll enjoy using Insiders, as it comes with several niceties.

]

[project.entry-points."mkdocs.plugins"]
search = "material.plugins.search.plugin:SearchPlugin"
Copy link
Owner

Choose a reason for hiding this comment

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

Could you please update the PR to include the social plugin? It was released as part of 8.5.0.

Copy link
Sponsor Collaborator Author

Choose a reason for hiding this comment

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

Done!

@squidfunk
Copy link
Owner

Thanks! One final question: Does pip install -e . still work with the proposed changes? I'm using this for development + users need to pip install . when they install from git. Otherwise, the documentation needs to be updated as well.

@ofek
Copy link
Sponsor Collaborator Author

ofek commented Sep 18, 2022

Yup, PEP 660 (-e) landed in https://pip.pypa.io/en/stable/news/#v21-3

@squidfunk
Copy link
Owner

Okay perfect. Let's give it another try. Thanks again for your patience!

@squidfunk squidfunk merged commit 16bb437 into master Sep 18, 2022
@ofek ofek deleted the modernize-metadata branch September 18, 2022 15:47
@squidfunk
Copy link
Owner

@ofek we're having an issue with Insiders. The Node.js plugin doesn't allow for local version identifiers:

This means that Insiders can currently not be installed. I need to revert this again for Insiders.

@ofek
Copy link
Sponsor Collaborator Author

ofek commented Sep 20, 2022

cc @agoose77

@agoose77
Copy link

@squidfunk this error stems from the fact that currently hatch-nodejs-version doesn't support local identifiers. This was a design choice, so that NPM and PEP440 versions could round-trip. However, I might have made a mistake here - I think both "local" (PEP440) and build (NPM) do not affect version resolution, and are defined by the same regex. I'll make a new release to address this oversight.

@squidfunk
Copy link
Owner

@agoose77 perfect, thanks for the quick response!

@agoose77
Copy link

Ah OK, I recall why I made this choice - In Python, local version segments are considered for comparison, whereas in npm they (build segments) are entirely ignored. I suppose that we might allow this, as long as users are aware of the differences.

@ofek
Copy link
Sponsor Collaborator Author

ofek commented Sep 20, 2022

Add an option?

@agoose77
Copy link

I've released a new version (0.3.0) of the hatchling plugin that should fix this issue according to @ofek

You should change the metadata to reflect this version as a lower bound (hatch-nodejs-version >= 0.3.0)

name = "mkdocs-material"
dynamic = [
"version",
"dependencies",
Copy link

@Kludex Kludex Oct 3, 2022

Choose a reason for hiding this comment

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

@ofek What does it mean for the dependencies to be dynamic?

mkdocs-material needs to depend on mkdocs>=1.4.0, but the installation doesn't ensure this. Is it because of the pip version, or is there something wrong here?

Copy link

Choose a reason for hiding this comment

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

@Kludex I can answer in part. Any field in pyproject.toml (besides name) can be dynamic, and it simply means that the build backend (e.g. hatchling) will provide this metadata: https://peps.python.org/pep-0621/#dynamic. My understanding is that the dynamic field itself is not directly used by PEP 517 frontends, rather it is useful for tools to know whether to ask the backend for metadata rather than just using the pyproject.toml file. @ofek might correct me here, though.

Copy link

Choose a reason for hiding this comment

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

The pyproject.toml file has dependencies set to dynamic, because the requirements_txt hook populates the depedencies metadata using https://github.com/squidfunk/mkdocs-material/blob/master/requirements.txt

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.

None yet

4 participants