From 063679b72dcd5822b52b7d6b05a7b6abd9456712 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Wed, 22 Oct 2025 11:55:07 +0800 Subject: [PATCH] [O] Moderize python build tool from setup-tools to hatchling --- MANIFEST.in | 9 -------- pyproject.toml | 51 ++++++++++++++++++++++++++++++++++++++++++++ setup.py | 58 -------------------------------------------------- 3 files changed, 51 insertions(+), 67 deletions(-) delete mode 100644 MANIFEST.in create mode 100644 pyproject.toml delete mode 100755 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 5bccc004..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,9 +0,0 @@ -include hyfetch/scripts/* - -recursive-exclude tools * -recursive-exclude .github * -recursive-exclude .vscode * -exclude .gitignore -exclude .gitattributes -exclude package.json -exclude CONTRIBUTING.md \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..c21eb1ea --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,51 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "HyFetch" +dynamic = ["version"] +description = "neofetch with flags <3" +readme = "README.md" +authors = [ + { name = "Azalea Gui", email = "me@hydev.org" }, +] +license = "MIT" +classifiers = [ + "License :: OSI Approved :: MIT License", + "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 :: 3.12", + "Programming Language :: Python :: 3.13", +] +dependencies = [ + # Universal dependencies + 'typing_extensions; python_version < "3.8"', + + # Windows dependencies + 'psutil ; platform_system=="Windows"', + 'colorama>=0.4.6 ; platform_system=="Windows"', +] + +[project.urls] +Homepage = "https://github.com/hykilpikonna/HyFetch" + +[project.scripts] +"hyfetch.v1" = "hyfetch.__main__:run_py" +"hyfetch.rs" = "hyfetch.__main__:run_rust" +"hyfetch" = "hyfetch.__main__:run_rust" + +[tool.hatch.version] +source = "regex" +path = "Cargo.toml" +regex = 'version = "(?P.+?)"' + +[tool.hatch.build] +exclude = ["/tools"] + +[tool.hatch.build.targets.wheel.files] +"{py_scripts}/neowofetch" = "hyfetch/scripts/neowofetch" diff --git a/setup.py b/setup.py deleted file mode 100755 index 0cb8d53b..00000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python3 -from pathlib import Path -from setuptools import setup, find_namespace_packages - -# The directory containing this file -HERE = Path(__file__).parent - -# Load version without importing it (see issue #192 if you are confused) -VERSION = [l for l in (HERE / "Cargo.toml").read_text('utf-8').splitlines() if l.startswith("version = ")] -if len(VERSION) != 1: - raise ValueError(f"Cannot determine version from Cargo.toml: {VERSION}") -VERSION = VERSION[0].split('"')[1] - -# The text of the README file -README = (HERE / "README.md").read_text('utf-8') - -# This call to setup() does all the work -setup( - name="HyFetch", - version=VERSION, - description="neofetch with flags <3", - long_description=README, - long_description_content_type="text/markdown", - url="https://github.com/hykilpikonna/HyFetch", - author="Azalea Gui", - author_email="me@hydev.org", - license="MIT", - classifiers=[ - "License :: OSI Approved :: MIT License", - "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 :: 3.12", - "Programming Language :: Python :: 3.13", - ], - packages=find_namespace_packages(exclude=("tools", "tools.*")), - package_data={'hyfetch': ['hyfetch/*']}, - include_package_data=True, - install_requires=[ - # Universal dependencies - 'typing_extensions; python_version < "3.8"', - - # Windows dependencies - 'psutil ; platform_system=="Windows"', - 'colorama>=0.4.6 ; platform_system=="Windows"', - ], - entry_points={ - "console_scripts": [ - "hyfetch.v1=hyfetch.__main__:run_py", - "hyfetch.rs=hyfetch.__main__:run_rust", - "hyfetch=hyfetch.__main__:run_rust", - ] - }, - scripts=['hyfetch/scripts/neowofetch'] -)