Skip to content

Commit

Permalink
Modernization: introduce pyproject.toml for setuptools configuration (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jayaddison committed Oct 23, 2022
1 parent 2c3e0e8 commit aacd321
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 52 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/publish.yaml
Expand Up @@ -15,11 +15,15 @@ jobs:
python-version: "3.x"
- name: Build the package
run: |
python -m pip install --user --upgrade setuptools wheel
python setup.py sdist bdist_wheel
python -m pip install --upgrade build
python -m build .
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
- name: Check setuptools and build versions used
run: |
pip list | grep setuptools
pip list | grep build
36 changes: 36 additions & 0 deletions .github/workflows/test_publish.yaml
@@ -0,0 +1,36 @@
name: test_publish


# Will attempt to build + publish package in test.pypi.org
#
# the build can be tested if it works as expected by installing the package with:
# pip install --index-url https://test.pypi.org/simple/ --no-deps recipe-scrapers
#
# or by inspecting the files: https://test.pypi.org/project/recipe-scrapers/#files
on: workflow_dispatch

jobs:
test_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Build the package
run: |
python -m pip install --upgrade build
python -m build .
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
verbose: true
skip_existing: true
- name: Check setuptools and build versions used
run: |
pip list | grep setuptools
pip list | grep build
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

39 changes: 39 additions & 0 deletions pyproject.toml
@@ -0,0 +1,39 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "recipe_scrapers"
description = "Python package, scraping recipes from all over the internet"
authors = [
{name = "Hristo Harsev", email = "r+pypi@hharsev.com"},
]
urls = {Homepage = "https://github.com/hhursev/recipe-scrapers/"}
keywords = ["python", "recipes", "scraper", "harvest", "recipe-scraper", "recipe-scrapers"]
license = {text = "MIT License"}
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Internet :: WWW/HTTP",
]
dynamic = ["version", "readme"]
requires-python = ">= 3.6"
dependencies = [
"beautifulsoup4 >= 4.10.0",
"extruct >= 0.8.0",
"isodate >= 0.6.1",
"requests >= 2.19.1",
]

[tool.setuptools.packages.find]
include = ["recipe_scrapers", "recipe_scrapers.*"]
exclude = ["tests", "tests.*"]

[tool.setuptools.dynamic]
readme = {file = "README.rst"}
version = {attr = "recipe_scrapers.__version__.__version__"}

[tool.setuptools.package-data]
recipe_scrapers = ["py.typed"]
44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

3 changes: 3 additions & 0 deletions tox.ini
@@ -1,3 +1,6 @@
[tox]
isolated_build = true

[testenv]
deps = -r{toxinidir}/requirements-dev.txt
commands = coverage run -m unittest
Expand Down

0 comments on commit aacd321

Please sign in to comment.