diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b78e19..6aea436 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,9 +18,9 @@ jobs: python-version: '3.12' - name: Create packages run: | - python -m pip install wheel setuptools - python setup.py sdist bdist_wheel + python -m pip install build + python -m build - name: Publish packages run: | python -m pip install twine - python -m twine upload dist/* --skip-existing --username __token__ --password ${{ secrets.pypi_password }} \ No newline at end of file + python -m twine upload dist/* --skip-existing --username __token__ --password ${{ secrets.pypi_password }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc4ccc1..6852efb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,5 +27,5 @@ jobs: pytest --cov=pytest_httpx --cov-fail-under=100 --cov-report=term-missing --runpytest=subprocess - name: Test packages creation run: | - python -m pip install wheel setuptools - python setup.py sdist bdist_wheel \ No newline at end of file + python -m pip install build + python -m build diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6fbae0a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,68 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "pytest-httpx" +dynamic = ["version"] +description = "Send responses to httpx." +readme = "README.md" +license = "MIT" +requires-python = ">=3.9" +authors = [ + { name = "Colin Bounouar", email = "colin.bounouar.dev@gmail.com" }, +] +maintainers = [ + { name = "Colin Bounouar", email = "colin.bounouar.dev@gmail.com" }, +] +keywords = [ + "httpx", + "mock", + "pytest", + "testing", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Framework :: Pytest", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Software Development :: Build Tools", + "Typing :: Typed", +] +dependencies = [ + "httpx==0.26.*", + "pytest>=7,<9", +] + +[project.optional-dependencies] +testing = [ + "pytest-asyncio==0.23.*", + "pytest-cov==4.*", +] + +[project.entry-points.pytest11] +pytest_httpx = "pytest_httpx" + +[project.urls] +Changelog = "https://github.com/Colin-b/pytest_httpx/blob/master/CHANGELOG.md" +Download = "https://pypi.org/project/pytest-httpx/" +GitHub = "https://github.com/Colin-b/pytest_httpx" +Homepage = "https://colin-b.github.io/pytest_httpx/" +Issues = "https://github.com/Colin-b/pytest_httpx/issues" + +[tool.hatch.version] +path = "pytest_httpx/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/pytest_httpx", +] + diff --git a/setup.py b/setup.py deleted file mode 100644 index f5bd6fd..0000000 --- a/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -import os -from setuptools import setup, find_packages - -this_dir = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(this_dir, "README.md"), "r") as f: - long_description = f.read() - - -# More information on properties: https://packaging.python.org/distributing -setup( - name="pytest_httpx", - version=open("pytest_httpx/version.py").readlines()[-1].split()[-1].strip("\"'"), - author="Colin Bounouar", - author_email="colin.bounouar.dev@gmail.com", - maintainer="Colin Bounouar", - maintainer_email="colin.bounouar.dev@gmail.com", - url="https://colin-b.github.io/pytest_httpx/", - description="Send responses to httpx.", - long_description=long_description, - long_description_content_type="text/markdown", - download_url="https://pypi.org/project/pytest-httpx/", - license="MIT", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Typing :: Typed", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Software Development :: Build Tools", - "Topic :: Internet :: WWW/HTTP", - "Framework :: Pytest", - ], - keywords=["pytest", "testing", "mock", "httpx"], - packages=find_packages(exclude=["tests*"]), - package_data={"pytest_httpx": ["py.typed"]}, - entry_points={"pytest11": ["pytest_httpx = pytest_httpx"]}, - install_requires=["httpx==0.26.*", "pytest>=7,<9"], - extras_require={ - "testing": [ - # Used to run async test functions - "pytest-asyncio==0.23.*", - # Used to check coverage - "pytest-cov==4.*", - ] - }, - python_requires=">=3.9", - project_urls={ - "GitHub": "https://github.com/Colin-b/pytest_httpx", - "Changelog": "https://github.com/Colin-b/pytest_httpx/blob/master/CHANGELOG.md", - "Issues": "https://github.com/Colin-b/pytest_httpx/issues", - }, - platforms=["Windows", "Linux"], -)