Skip to content

Commit fd66aa3

Browse files
committed
Switch build system from setuptools to Poetry for packaging and publishing
This PR migrates the project from setuptools to Poetry for dependency management, building, and publishing. - Added full project metadata and dependencies to pyproject.toml using Poetry format. - Removed reliance on setup.py and requirements.txt for runtime dependencies. - Updated the GitHub Actions workflow to use Poetry for installing dependencies and building distributions. - Development dependencies (e.g., `pytest`) are now managed via Poetry’s dev group. - Simplifies and modernizes the packaging process, making it more reproducible and easier to maintain. Poetry provides a unified, modern workflow for Python packaging, dependency management, and publishing. This change reduces redundancy, improves reproducibility, and aligns with current best practices in the Python ecosystem. Closes #19.
1 parent 25c57db commit fd66aa3

3 files changed

Lines changed: 37 additions & 11 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,20 @@ jobs:
2727
with:
2828
python-version: "3.x"
2929

30+
- name: Install Poetry
31+
run: |
32+
curl -sSL https://install.python-poetry.org | python3 -
33+
export PATH="$HOME/.local/bin:$PATH"
34+
35+
- name: Install dependencies
36+
run: |
37+
export PATH="$HOME/.local/bin:$PATH"
38+
poetry install --no-interaction --no-root
39+
3040
- name: Build release distributions
3141
run: |
32-
# NOTE: put your own distribution build steps here.
33-
python -m pip install build
34-
python -m pip install -r requirements.txt
35-
python -m build
42+
export PATH="$HOME/.local/bin:$PATH"
43+
poetry build
3644
3745
- name: Upload distributions
3846
uses: actions/upload-artifact@v4

pyproject.toml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1-
[build-system]
2-
requires = [
3-
"setuptools>=40.8.0",
4-
"wheel",
5-
"python-dotenv"
1+
[project]
2+
name = "youtubewikibot"
3+
version = "0.1.1"
4+
description = "A bot to create a database of the most popular creators on YouTube."
5+
authors = [
6+
{name = "Luis Imperial",email = "imperialluisanton@outlook.ph"}
7+
]
8+
license = {text = "MIT"}
9+
readme = "README.md"
10+
requires-python = ">=3.10"
11+
dependencies = [
12+
"google-api-python-client (>=2.173.0,<3.0.0)",
13+
"python-dotenv (>=1.1.0,<2.0.0)",
14+
"mwclient (>=0.11.0,<0.12.0)",
15+
"pycountry (>=24.6.1,<25.0.0)"
616
]
7-
build-backend = "setuptools.build_meta"
17+
18+
19+
[build-system]
20+
requires = ["poetry-core>=2.0.0,<3.0.0"]
21+
build-backend = "poetry.core.masonry.api"
22+
23+
[tool.poetry.group.dev.dependencies]
24+
pytest = "^8.4.1"
25+

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def read_requirements():
1414

1515
setup(
1616
name='YouTubeWikiBot',
17-
version='0.1',
17+
version='0.1.1',
1818
author='Luis Imperial',
1919
author_email=AUTHOR_EMAIL,
2020
description='A bot to create a database of the most popular creators on YouTube.',

0 commit comments

Comments
 (0)