Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernization: introduce pyproject.toml for setuptools configuration #655

Merged
merged 25 commits into from Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
760f34e
Migrate unit testing and linting to use tox
jayaddison Oct 17, 2022
43c30f2
Remove typing-related modules from library dependencies
jayaddison Oct 17, 2022
612651a
Cleanup: remove empty tox.ini section
jayaddison Oct 17, 2022
1092ee8
Fixup: yaml key name in GitHub Actions workflows (was:name, intended:…
jayaddison Oct 17, 2022
fe9bcc6
Relocate platform-specific binary installation of lxml from GitHub Ac…
jayaddison Oct 17, 2022
520b386
Nitpick: disambiguate between platform regex and tox environment name…
jayaddison Oct 17, 2022
5051258
Cleanup: remove package self-installation-dependency from dev-require…
jayaddison Oct 18, 2022
fba55ca
Introduce pyproject.toml as packaging configuration for the library
jayaddison Oct 18, 2022
be58720
Merge branch 'main' into issue-617/tox-plus-setuptools-pyproject
jayaddison Oct 20, 2022
5d5b44a
Merge branch 'main' into issue-617/tox-plus-setuptools-pyproject
jayaddison Oct 20, 2022
91aaf3a
Add legacy-compatible setup.py (follows guidance at https://setuptool…
jayaddison Oct 20, 2022
d25b602
Merge branch 'main' into issue-617/tox-plus-setuptools-pyproject
jayaddison Oct 22, 2022
5900d6e
Fixup: correction for package inclusion/discovery
jayaddison Oct 22, 2022
a1e2663
Consistency / compatibility: maintain package name produced by former…
jayaddison Oct 22, 2022
2f86911
Let's keep the scrapers in the package, too
jayaddison Oct 22, 2022
9fe154e
Add an exclude entry for the tests modules, corresponding to the prev…
jayaddison Oct 22, 2022
16a05f2
Add MIT License as text otherwise there's too much gibberish shown in…
hhursev Oct 22, 2022
986c8d8
Remove setup.py file
hhursev Oct 22, 2022
ec92eed
Update publish.yaml. Add test_publish too
hhursev Oct 22, 2022
5d9cad4
Bump version to test build
hhursev Oct 22, 2022
d4c1f13
Merge branch 'main' into issue-617/tox-plus-setuptools-pyproject
hhursev Oct 22, 2022
f00c5fc
Run the test_publish action on push in this branch first. Couldnt fig…
hhursev Oct 22, 2022
b6142d1
Misc. remove intervals after/before brackets
hhursev Oct 22, 2022
ab117c7
Adjust test_publish. Should be visible in actions section once merged…
hhursev Oct 22, 2022
4adc3cb
Revert "Bump version to test build"
hhursev Oct 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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