Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-python@v6

with:
python-version: 3.13
python-version: "3.14"

- name: Build package
run: |
Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ on:
- "v*"
workflow_dispatch:

permissions:
contents: read

concurrency:
# To reduce rate limitation issues, avoid running multiple workflows in
# paralell for the same git ref (PR / branch / tag) at the same time by
# discarding older in-progress runs in favor of the newest.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-24.04
Expand All @@ -17,7 +27,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.13
python-version: "3.14"

# ref: https://github.com/pre-commit/action
- uses: pre-commit/action@v3.0.1
Expand All @@ -35,16 +45,16 @@ jobs:
tests:
runs-on: ubuntu-24.04
env:
# Use TOKEN_READONLY if available (pushed branches), otherwise use GITHUB_TOKEN (PRs)
# TOKEN_READONLY is a PAT for @choldgraf that only has read-access to this repo but isn't available in PRs.
GITHUB_ACCESS_TOKEN: "${{ secrets.TOKEN_READONLY || secrets.GITHUB_TOKEN }}"
Comment on lines -38 to -40
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of this token failed in another way then using the workflow's github.token (aka secrets.GITHUB_TOKEN), so instead of debugging it etc, I removed it and reduced the burden on rate limiting to stabilize things that way.

GITHUB_ACCESS_TOKEN: "${{ github.token }}"
strategy:
# max-parallel declared to reduce rate limitation issues
max-parallel: 1
matrix:
include:
# Only test oldest supported and latest python version to reduce
# GitHub API calls, as they can get rate limited
- python-version: "3.10"
- python-version: 3.x
- python-version: "3.10"

steps:
- uses: actions/checkout@v6
Expand All @@ -54,10 +64,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[testing]
pip install -e ".[testing]"

- name: Run tests
run: pytest --verbose --color=yes --durations=10
run: pytest

docs:
runs-on: ubuntu-24.04
Expand All @@ -66,11 +76,11 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.13
python-version: "3.14"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[sphinx]
pip install -e ".[sphinx]"

- name: Build docs
run: |
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sphinx:
build:
os: ubuntu-24.04
tools:
python: "3.13"
python: "3.14"

python:
install:
Expand Down
4 changes: 0 additions & 4 deletions docs/requirements.txt

This file was deleted.

5 changes: 1 addition & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@nox.session
def changelog(session):
"""Run github activity on this repository with the current repo."""
session.install("-r", "requirements.txt")
session.install("-e", ".")

# Run github activity and re-use the posargs
Expand All @@ -18,7 +17,6 @@ def changelog(session):
def docs(session):
"""Run github activity on this repository with the current repo."""
session.install("-e", ".[sphinx]")
session.install("-r", "docs/requirements.txt")

if "live" in session.posargs:
session.install("sphinx-autobuild")
Expand All @@ -38,9 +36,8 @@ def docs(session):
@nox.session
def test(session):
"""Run github activity on this repository with the current repo."""
session.install("-r", "requirements.txt")
session.install("-e", ".[testing]")

# Run github activity and re-use the posargs
cmd = ["pytest", "--verbose", "--durations=10"] + session.posargs
cmd = ["pytest"] + session.posargs
session.run(*cmd)
30 changes: 24 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
requires = ["setuptools>=77", "setuptools-scm"]
build-backend = "setuptools.build_meta"


[project]
name = "github_activity"
description = "Grab recent issue/PR activity from a GitHub repository and render it as markdown."
Expand All @@ -23,17 +24,20 @@ Source = "https://github.com/executablebooks/github-activity"
[project.optional-dependencies]
testing = [
"pytest",
"pytest-cov",
"pytest-regressions",
]
sphinx = [
"sphinx",
"myst_parser",
"sphinx_book_theme",
"sphinx>=5",
"sphinx-design",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was part of docs/requirements.txt, but not here, so I added it here.

"sphinx_book_theme>=1",
]

[project.scripts]
github-activity = "github_activity.cli:main"


[tool.setuptools]
zip-safe = false
include-package-data = true
Expand All @@ -52,8 +56,25 @@ dependencies = { file = "requirements.txt" }
# only the file-finder
fallback_version = "0.0.0"


[tool.ruff.lint.per-file-ignores]
"docs/conf.py" = ["E402"]


# pytest is used for running Python based tests
#
# ref: https://docs.pytest.org/en/stable/
#
[tool.pytest.ini_options]
addopts = "--verbose --color=yes --durations=10 --cov=github_activity"
testpaths = ["tests"]


[tool.coverage.run]
patch = ["subprocess"]


[tool.tbump]
# Uncomment this if your project is hosted on GitHub:
github_url = "https://github.com/executablebooks/github-activity"

[tool.tbump.version]
Expand Down Expand Up @@ -81,6 +102,3 @@ search = 'version = "{current_version}"'
[[tool.tbump.file]]
src = "github_activity/__init__.py"
search = '__version__ = "{current_version}"'

[tool.ruff.lint.per-file-ignores]
"docs/conf.py" = ["E402"]
Loading