-
-
Notifications
You must be signed in to change notification settings - Fork 270
Update package metadata #1640
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
Closed
Closed
Update package metadata #1640
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| """Dynamically define some metadata.""" | ||
| import os | ||
|
|
||
| from hatchling.metadata.plugin.interface import MetadataHookInterface | ||
|
|
||
|
|
||
| def get_version_dev_status(root): | ||
| """Get version_info without importing the entire module.""" | ||
|
|
||
| import importlib.util | ||
|
|
||
| path = os.path.join(root, "pymdownx", "__meta__.py") | ||
| spec = importlib.util.spec_from_file_location("__meta__", path) | ||
| module = importlib.util.module_from_spec(spec) | ||
| spec.loader.exec_module(module) | ||
| return module.__version_info__._get_dev_status() | ||
|
|
||
|
|
||
| def get_requirements(root): | ||
| """Load list of dependencies.""" | ||
|
|
||
| install_requires = [] | ||
| with open(os.path.join(root, "requirements", "project.txt")) as f: | ||
| for line in f: | ||
| if not line.startswith("#"): | ||
| install_requires.append(line.strip()) | ||
| return install_requires | ||
|
|
||
|
|
||
| class CustomMetadataHook(MetadataHookInterface): | ||
| """Our metadata hook.""" | ||
|
|
||
| def update(self, metadata): | ||
| """See https://ofek.dev/hatch/latest/plugins/metadata-hook/ for more information.""" | ||
|
|
||
| metadata["dependencies"] = get_requirements(self.root) | ||
| metadata["classifiers"] = [ | ||
| f"Development Status :: {get_version_dev_status(self.root)}", | ||
| "Environment :: Console", | ||
| "Intended Audience :: Developers", | ||
| "License :: OSI Approved :: MIT License", | ||
| "Operating System :: OS Independent", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.7", | ||
| "Programming Language :: Python :: 3.8", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Topic :: Internet :: WWW/HTTP :: Dynamic Content", | ||
| "Topic :: Software Development :: Libraries :: Python Modules", | ||
| "Topic :: Text Processing :: Filters", | ||
| "Topic :: Text Processing :: Markup :: HTML", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,52 @@ | ||
| [build-system] | ||
| requires = [ | ||
| "setuptools>=42", | ||
| "wheel" | ||
| "hatchling>=0.21.0", | ||
| ] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| build-backend = "setuptools.build_meta" | ||
| [project] | ||
| name = "pymdown-extensions" | ||
| description = "Extension pack for Python Markdown." | ||
| readme = "README.md" | ||
| license = "MIT" | ||
| requires-python = ">=3.7" | ||
| authors = [ | ||
| { name = "Isaac Muse", email = "Isaac.Muse@gmail.com" }, | ||
| ] | ||
| keywords = [ | ||
| "extensions", | ||
| "markdown", | ||
| ] | ||
| dynamic = [ | ||
| "classifiers", | ||
| "dependencies", | ||
| "version", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/facelessuser/pymdown-extensions" | ||
|
|
||
| [tool.hatch.version] | ||
| source = "code" | ||
| path = "pymdownx/__meta__.py" | ||
|
|
||
| [tool.hatch.build.targets.sdist] | ||
| include = [ | ||
| "/docs/src/markdown", | ||
| "/docs/theme", | ||
| "/requirements/*.txt", | ||
| "/pymdownx", | ||
| "/tests", | ||
| "/.coveragerc", | ||
| "/.dictionary", | ||
| "/mkdocs.yml", | ||
| "/run_tests.py", | ||
| "/tox.ini", | ||
| ] | ||
|
|
||
| [tool.hatch.build.targets.wheel] | ||
| include = [ | ||
| "/pymdownx", | ||
| ] | ||
|
|
||
| [tool.hatch.metadata.hooks.custom] | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| [tox] | ||
| isolated_build = true | ||
| envlist = | ||
| {py37,py38,py39,py310}, lint, documents | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE TO SELF: not sure if the includes are all correct. Will need to double-check that we are including what we expect in the sdist and not what we don't.