From 5740c5c8ff673f8acf509f3dbb792657a263eb30 Mon Sep 17 00:00:00 2001 From: slaveeks Date: Thu, 24 Oct 2024 03:36:17 +0300 Subject: [PATCH 1/2] feat: packaging is changed to hatchling --- Makefile | 8 ++--- pyproject.toml | 24 ++++++++++++++ setup.py | 34 -------------------- {hawkcatcher => src/hawkcatcher}/__init__.py | 0 {hawkcatcher => src/hawkcatcher}/core.py | 0 {hawkcatcher => src/hawkcatcher}/errors.py | 0 {hawkcatcher => src/hawkcatcher}/types.py | 0 7 files changed, 28 insertions(+), 38 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py rename {hawkcatcher => src/hawkcatcher}/__init__.py (100%) rename {hawkcatcher => src/hawkcatcher}/core.py (100%) rename {hawkcatcher => src/hawkcatcher}/errors.py (100%) rename {hawkcatcher => src/hawkcatcher}/types.py (100%) diff --git a/Makefile b/Makefile index 3e2bfc5..c260882 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,13 @@ help: @echo " clean ------------ - Clean all distribution build artifacts." @echo " clean-pyc ------ - Remove .pyc/__pycache__ files." @echo " clean-build ---- - Remove setup artifacts." - @echo " build ------------ - Regenarate setup.py and rebuild python package." + @echo " build ------------ - Rebuild python package." @echo "upload ------------- - Upload built python package on pypi server." install: $(PIP) install -r requirements/dev.txt $(PIP) install -r requirements/requirements.txt + $(PYTHON) -m pip install --upgrade build twine test: $(PYTHON) -m pytest @@ -30,10 +31,9 @@ clean-build: clean: clean-pyc clean-build build: - $(PYTHON) generate_setup.py - $(PYTHON) setup.py sdist bdist_wheel + $(PYTHON) -m build dist: clean build upload: - $(PYTHON) setup.py sdist upload -r "${PYPISERVERNAME}" + $(PYTHON) -m twine upload -r "${PYPISERVERNAME}" dist/* diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a3d6d0b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,24 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" +[project] +dynamic = ["version"] +dependencies = ["requests"] +name = "hawkcatcher" +authors = [{ name = "CodeX Team", email = "team@codex.so" }] +description = "Python errors Catcher module for Hawk." +readme = "README.md" +requires-python = ">=3.5" +classifiers = [ + "Intended Audience :: Developers", + "Topic :: Software Development :: Bug Tracking", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.5", + "Environment :: Console", + "Environment :: Web Environment", +] +[tool.hatch.version] +path = "src/hawkcatcher/__init__.py" +[project.urls] +Homepage = "https://github.com/codex-team/hawk.python" +Issues = "https://github.com/codex-team/hawk.python/issues" diff --git a/setup.py b/setup.py deleted file mode 100644 index 4a834cc..0000000 --- a/setup.py +++ /dev/null @@ -1,34 +0,0 @@ -from os.path import join, dirname - -from setuptools import setup, find_packages -from hawkcatcher import __version__ - - -def load_doc(): - with open(join(dirname(__file__), 'README.md')) as file: - return file.read() - - -setup( - name='hawkcatcher', - version=__version__, - packages=find_packages(), - description='Python errors Catcher module for Hawk.', - long_description=load_doc(), - keywords='catcher hawk codex bug errors tracker', - url='https://github.com/codex-team/deployserver', - author='CodeX Team', - author_email='team@ifmo.su', - license='MIT', - long_description_content_type='text/markdown', - classifiers=[ - 'Intended Audience :: Developers', - 'Topic :: Software Development :: Bug Tracking', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.5', - 'Environment :: Console', - 'Environment :: Web Environment', - ], - install_requires=['requests'], - python_requires='>=3.5' -) diff --git a/hawkcatcher/__init__.py b/src/hawkcatcher/__init__.py similarity index 100% rename from hawkcatcher/__init__.py rename to src/hawkcatcher/__init__.py diff --git a/hawkcatcher/core.py b/src/hawkcatcher/core.py similarity index 100% rename from hawkcatcher/core.py rename to src/hawkcatcher/core.py diff --git a/hawkcatcher/errors.py b/src/hawkcatcher/errors.py similarity index 100% rename from hawkcatcher/errors.py rename to src/hawkcatcher/errors.py diff --git a/hawkcatcher/types.py b/src/hawkcatcher/types.py similarity index 100% rename from hawkcatcher/types.py rename to src/hawkcatcher/types.py From 13ec47d75f6e40a99fbe97d557d480e8c4303139 Mon Sep 17 00:00:00 2001 From: Vyacheslav Chernyshev <81693471+slaveeks@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:56:43 +0300 Subject: [PATCH 2/2] Update Makefile Co-authored-by: Aleksandr Menshchikov --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c260882..a0951a8 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,8 @@ help: @echo " clean ------------ - Clean all distribution build artifacts." @echo " clean-pyc ------ - Remove .pyc/__pycache__ files." @echo " clean-build ---- - Remove setup artifacts." - @echo " build ------------ - Rebuild python package." + @echo " build ------------ - Rebuild python package." + @echo "upload ------------- - Upload built python package on pypi server." install: