-
-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(hatch): switch from setuptools to hatch
- Loading branch information
Showing
6 changed files
with
117 additions
and
214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
qa: | ||
tox | ||
hatch run style:format | ||
hatch run style:check | ||
|
||
clean: | ||
rm -rf dist | ||
hatch clean | ||
|
||
release: clean qa test | ||
python3 setup.py sdist && python3 -m twine upload dist/* | ||
release: clean qa test build | ||
hatch publish -u __token__ | ||
|
||
serve: | ||
mkdocs serve | ||
|
||
build: | ||
mkdocs build | ||
hatch build | ||
|
||
# TODO: maybe move the docs to github | ||
#deploy: qa test | ||
# mkdocs gh-deploy | ||
|
||
test: | ||
pytest -xsvv | ||
hatch run all |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "py3status" | ||
dynamic = ["version"] | ||
description = "py3status: an extensible i3status wrapper written in python" | ||
readme = "README.md" | ||
license = "BSD-2-Clause" | ||
requires-python = ">=3.7" | ||
authors = [ | ||
{ name = "Ultrabug", email = "ultrabug@ultrabug.net" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
dependencies = [] | ||
|
||
[project.optional-dependencies] | ||
udev = ["pyudev >= 0.21.0"] | ||
|
||
[project.urls] | ||
Download = "https://github.com/ultrabug/py3status/tags" | ||
Homepage = "https://github.com/ultrabug/py3status" | ||
|
||
[project.scripts] | ||
py3status = "py3status:main" | ||
py3-cmd = "py3status.command:send_command" | ||
|
||
[tool.hatch.version] | ||
path = "py3status/version.py" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
include = [ | ||
"/py3status", | ||
] | ||
|
||
[tool.hatch.envs.default.scripts] | ||
all = [ | ||
"hatch run test:test", | ||
"hatch run style:check", | ||
] | ||
|
||
[tool.hatch.envs.test] | ||
dependencies = [ | ||
"pytest" | ||
] | ||
|
||
[tool.hatch.envs.test.scripts] | ||
test = [ | ||
"pytest -xs", | ||
] | ||
|
||
[[tool.hatch.envs.test.matrix]] | ||
python = ["py37", "py38", "py39", "py310", "py311"] | ||
type = ["default"] | ||
|
||
[tool.hatch.envs.style] | ||
detached = true | ||
dependencies = [ | ||
"black", | ||
"isort", | ||
"ruff", | ||
] | ||
|
||
[tool.hatch.envs.style.scripts] | ||
check = [ | ||
"isort --check-only --diff py3status", | ||
"black -q --check --diff py3status", | ||
"ruff py3status", | ||
] | ||
format = [ | ||
"isort -q py3status", | ||
"black -q py3status", | ||
] | ||
|
||
[tool.black] | ||
line-length = 100 | ||
target-version = ["py310"] | ||
skip-string-normalization = true | ||
|
||
[tool.isort] | ||
profile = "black" | ||
line_length = 100 | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
ignore = ["E501"] |
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,64 +1,13 @@ | ||
""" | ||
py3status | ||
""" | ||
"""Installation using setup.py is no longer supported. | ||
Use `python -m pip install .` instead.""" | ||
|
||
from setuptools import find_packages, setup | ||
import fastentrypoints # noqa f401 | ||
import sys | ||
from pathlib import Path | ||
|
||
module_path = Path(__file__).resolve().parent / "py3status" | ||
sys.path.insert(0, str(module_path)) | ||
from version import version # noqa e402 | ||
from setuptools import setup | ||
|
||
sys.path.remove(str(module_path)) | ||
|
||
|
||
# Utility function to read the README file. | ||
# Used for the long_description. It's nice, because now 1) we have a top level | ||
# README file and 2) it's easier to type in the README file than to put a raw | ||
# string in below ... | ||
def read(fname): | ||
return (Path(__file__).resolve().parent / fname).read_text() | ||
|
||
|
||
# extra requirements | ||
req_udev = ["pyudev >= 0.21.0"] | ||
req_all = req_udev | ||
sys.exit(__doc__) | ||
|
||
# Fake reference so GitHub still considers it a real package for statistics purposes. | ||
setup( | ||
name="py3status", | ||
version=version, | ||
author="Ultrabug", | ||
author_email="ultrabug@ultrabug.net", | ||
description="py3status: an extensible i3status wrapper written in python", | ||
long_description=read("README.md"), | ||
long_description_content_type="text/markdown", | ||
extras_require={"all": req_all, "udev": req_udev}, | ||
url="https://github.com/ultrabug/py3status", | ||
download_url="https://github.com/ultrabug/py3status/tags", | ||
license="BSD", | ||
platforms="any", | ||
packages=find_packages(), | ||
include_package_data=True, | ||
install_requires=["setuptools"], | ||
entry_points={ | ||
"console_scripts": [ | ||
"py3status = py3status:main", | ||
"py3-cmd = py3status.command:send_command", | ||
] | ||
}, | ||
python_requires=">=3.7", | ||
classifiers=[ | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
], | ||
) |