Skip to content

Commit

Permalink
Use uv for dependency management (#56)
Browse files Browse the repository at this point in the history
* Update pyproject.toml to new standard.

* Use uv for dependency management

* Remove now unnecessary version number in init file.

* Update CI/CD

* Add dependabot file
  • Loading branch information
EndlessTrax authored Oct 4, 2024
1 parent ff752b2 commit 2013a81
Show file tree
Hide file tree
Showing 8 changed files with 611 additions and 520 deletions.
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
reviewers:
- "endlesstrax"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
reviewers:
- "endlesstrax"
24 changes: 15 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,25 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flit
run: uv python install 3.12

- name: Build package
run: flit build
run: uv build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} ./dist/* --generate-notes
23 changes: 10 additions & 13 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt --no-deps
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Run pytest
run: pytest --cov
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Coverage report
run: bash <(curl -s https://codecov.io/bash)
- name: Install the project
run: uv sync --all-extras --dev

- name: Run tests
run: uv run pytest
2 changes: 0 additions & 2 deletions pyanchor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
"""Check you site for broken links!"""

__version__ = "0.7.3"
49 changes: 31 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[build-system]
requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.flit.metadata]
module = "pyanchor"
author = "Ricky White"
author-email = "[email protected]"
home-page = "https://github.com/EndlessTrax/pyanchor/"
[project]
name = "pyanchor"
version = "0.7.3"
authors = [
{name="Ricky White", email="[email protected]"},
]
description = "Find your broken links, so users don't."
readme = "README.md"
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.8",
Expand All @@ -15,19 +18,29 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
]
description-file="README.md"
requires = [
"beautifulsoup4==4.11.1",
"requests==2.31.0",
"typer==0.5.0",
"lxml==4.9.2",
"colorama==0.4.5"
requires-python = ">=3.8"
dependencies = [
"beautifulsoup4>=4.12.3",
"colorama>=0.4.6",
"lxml>=5.3.0",
"requests>=2.32.3",
"typer>=0.12.5",
]
requires-python=">=3.8"

[tool.flit.metadata.urls]
[project.scripts]
pyanchor = "pyanchor.cli:app"

[project.urls]
Homepage = "https://github.com/EndlessTrax/pyanchor/"
Documentation = "https://github.com/EndlessTrax/pyanchor/blob/master/README.md"
Repository = "https://github.com/EndlessTrax/pyanchor.git"
Issues = "https://github.com/EndlessTrax/pyanchor/issues"

[tool.flit.scripts]
pyanchor = "pyanchor.cli:app"
[tool.uv]
dev-dependencies = [
"flask>=3.0.3",
"pytest>=8.3.3",
"pytest-cov>=5.0.0",
"python-dotenv>=1.0.1",
"ruff>=0.6.8",
]
14 changes: 0 additions & 14 deletions requirements.in

This file was deleted.

Loading

0 comments on commit 2013a81

Please sign in to comment.