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/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

version: 2
updates:
- package-ecosystem: "pip"
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "daily"
24 changes: 10 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
# Keep a fixed runtime for the full dependency set.
python-version: "3.11"
version: "0.11.26"
enable-cache: true
- uses: actions/cache@v3
with:
path: |
~/.cache/pre-commit
~/.cache/pip
key: pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('.pre-commit-config.yaml') }}
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.python-version', '.pre-commit-config.yaml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit mypy
python -m pip install -r requirements-dev.txt
run: uv sync --locked
- name: Run tests
run: pytest
run: uv run --locked pytest
- name: Run pre-commit
run: pre-commit run --verbose --all-files --show-diff-on-failure
run: uv run --locked pre-commit run --verbose --all-files --show-diff-on-failure
# FIXME: mypy is failing due to missing types-* packages
# - name: Run mypy
# run: mypy algorithms_keeper/ tests/
# run: uv run --locked mypy algorithms_keeper/ tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ local/
.env

# Environments
.venv/
env/
venv/

# Coverage
.coverage
coverage.xml
htmlcov/

# pyenv
.python-version
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ Some actions of the bot can be triggered using commands:

***NOTE: Commands are in BETA and valid only if it is commented on a pull request and only by either a member or owner of the organization.***

## Development

Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then set up
the project and run tests from the repository root:

```shell
uv sync
uv run pytest
```

## Logging
Logging is done using the standard library logging module. All the API calls made by the bot are being logged at INFO level and `aiohttp.log.access_logger` is logging the POST requests made by GitHub for delivering the payload. Other minor events relevant to the repository is also being logged along with using the using [Sentry](https://sentry.io/). The logs can be viewed best using the following command ([_requires Heroku CLI_](https://devcenter.heroku.com/articles/heroku-cli#download-and-install)):
```shell
Expand Down
28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
[project]
name = "algorithms-keeper"
version = "0.1.0"
description = "A GitHub bot for TheAlgorithms/Python"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"aiohttp==3.14.3",
"cachetools==5.3.2",
"fixit==2.2.1",
"gidgethub==5.3.0",
"libcst==1.1.0",
"sentry-sdk==2.68.1",
]

[dependency-groups]
dev = [
"mypy",
"pre-commit",
"pytest==9.1.1",
"pytest-aiohttp==1.0.5",
"pytest-asyncio==1.4.0",
"pytest-cov==4.1.0",
]

[tool.uv]
package = false

[tool.mypy]
ignore_missing_imports = true
warn_unused_configs = true
Expand Down
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

1,659 changes: 1,659 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

Loading