-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #240 from facelessuser/chore/hatch-backend
Use hatch as the build backend
- Loading branch information
Showing
28 changed files
with
148 additions
and
160 deletions.
There are no files selected for viewing
This file contains 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 contains 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 contains 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 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
File renamed without changes.
File renamed without changes.
This file contains 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,4 @@ | ||
--8<-- | ||
links.md | ||
abbr.md | ||
--8<-- |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains 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 contains 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 contains 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,23 +1,3 @@ | ||
# License | ||
|
||
MIT License | ||
|
||
Copyright (c) 2018 - 2021 Isaac Muse <isaacmuse@gmail.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
--8<-- "LICENSE.md" |
This file contains 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 contains 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 contains 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 contains 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 contains 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 contains 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 contains 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 contains 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,51 @@ | ||
"""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, "soupsieve", "__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', | ||
'Typing :: Typed' | ||
] |
This file contains 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 contains 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,14 +1,69 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel" | ||
"hatchling>=0.21.1", | ||
] | ||
build-backend = "hatchling.build" | ||
|
||
build-backend = "setuptools.build_meta" | ||
[project] | ||
name = "soupsieve" | ||
description = "A modern CSS selector implementation for Beautiful Soup." | ||
readme = "README.md" | ||
license = "MIT" | ||
requires-python = ">=3.6" | ||
authors = [ | ||
{ name = "Isaac Muse", email = "Isaac.Muse@gmail.com" }, | ||
] | ||
keywords = [ | ||
"CSS", | ||
"HTML", | ||
"XML", | ||
"selector", | ||
"filter", | ||
"query", | ||
"soup" | ||
] | ||
dynamic = [ | ||
"classifiers", | ||
"dependencies", | ||
"version", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/facelessuser/soupsieve" | ||
|
||
[tool.hatch.version] | ||
source = "code" | ||
path = "soupsieve/__meta__.py" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
include = [ | ||
"/soupsieve", | ||
] | ||
|
||
[tool.hatch.build.targets.sdist] | ||
include = [ | ||
"/docs/src/markdown/**/*.md", | ||
"/docs/src/markdown/**/*.gif", | ||
"/docs/src/markdown/**/*.png", | ||
"/docs/src/markdown/dictionary/*.txt", | ||
"/docs/theme/**/*.css", | ||
"/docs/theme/**/*.js", | ||
"/docs/theme/**/*.html", | ||
"/requirements/*.txt", | ||
"/soupsieve/**/*.py", | ||
"/soupsieve/py.typed", | ||
"/tests/**/*.py", | ||
"/.pyspelling.yml", | ||
"/.coveragerc", | ||
"/mkdocs.yml", | ||
"/tox.ini", | ||
] | ||
|
||
[tool.mypy] | ||
files = [ | ||
"soupsieve/*.py" | ||
"soupsieve" | ||
] | ||
strict = true | ||
show_error_codes = true | ||
|
||
[tool.hatch.metadata.hooks.custom] |
This file contains 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,4 @@ | ||
mkdocs_pymdownx_material_extras==1.5.5 | ||
mkdocs_pymdownx_material_extras>=2.0 | ||
mkdocs-git-revision-date-localized-plugin | ||
mkdocs-minify-plugin | ||
pyspelling |
Oops, something went wrong.