-
Notifications
You must be signed in to change notification settings - Fork 268
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
Upgrade tooling on the project. #1329
base: master
Are you sure you want to change the base?
Changes from all commits
1d5c73d
22198e8
0f8011a
ef246bb
fd22912
21ba777
3a17200
895e6f6
a65be37
4e2090b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Lint & unit tests | ||
name: CI | ||
|
||
on: | ||
push: | ||
|
@@ -15,20 +15,15 @@ jobs: | |
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: 'pip' | ||
cache-dependency-path: '**/pyproject.toml' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: Install uv | ||
run: pip install uv | ||
- name: Run Lint | ||
run: tox -e lint | ||
run: | | ||
make lint | ||
|
||
test: | ||
# Dependency on linting to avoid running our expensive matrix test for nothing | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
# Use postgresql and MariaDB versions of Debian bookworm | ||
services: | ||
postgres: | ||
image: postgres:15 | ||
|
@@ -56,7 +51,6 @@ jobs: | |
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] | ||
dependencies: [normal] | ||
database: [sqlite] | ||
# Test other databases with only a few versions of Python (Debian bullseye has 3.9, bookworm has 3.11) | ||
include: | ||
- python-version: 3.9 | ||
dependencies: normal | ||
|
@@ -70,7 +64,6 @@ jobs: | |
- python-version: 3.11 | ||
dependencies: normal | ||
database: mariadb | ||
# Try a few variants with the minimal versions supported | ||
- python-version: 3.7 | ||
dependencies: minimal | ||
database: sqlite | ||
|
@@ -97,30 +90,31 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: '**/pyproject.toml' | ||
- name: Install uv | ||
run: pip install uv | ||
- name: install python from uv | ||
run: | | ||
uv python install ${{ matrix.python-version }} | ||
uv venv --python ${{ matrix.python-version }} .venv | ||
- name: Change dependencies to minimal supported versions | ||
run: sed -i -e 's/>=/==/g; s/~=.*==\(.*\)/==\1/g; s/~=/==/g;' pyproject.toml | ||
run: sed -i -e '/requires-python/!s/>=/==/g; /requires-python/!s/~=.*==\(.*\)/==\1/g; /requires-python/!s/~=/==/g;' pyproject.toml | ||
if: matrix.dependencies == 'minimal' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this do? Maybe add a comment. |
||
- name: Install dependencies | ||
- name: Run tests | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
# Run tox using the version of Python in `PATH` | ||
- name: Run Tox with sqlite | ||
run: tox -e py | ||
if: matrix.database == 'sqlite' | ||
python --version | ||
make test | ||
env: | ||
TESTING_SQLALCHEMY_DATABASE_URI: 'sqlite:///budget.db' | ||
- name: Run Tox with postgresql | ||
run: tox -e py | ||
if: matrix.database == 'postgresql' | ||
env: | ||
TESTING_SQLALCHEMY_DATABASE_URI: 'postgresql+psycopg2://postgres:ihatemoney@localhost:5432/ihatemoney_ci' | ||
- name: Run Tox with mariadb | ||
run: tox -e py | ||
if: matrix.database == 'mariadb' | ||
env: | ||
TESTING_SQLALCHEMY_DATABASE_URI: 'mysql+pymysql://root:ihatemoney@localhost:3306/ihatemoney_ci' | ||
TESTING_SQLALCHEMY_DATABASE_URI: ${{ matrix.database == 'sqlite' && 'sqlite:///budget.db' || matrix.database == 'postgresql' && 'postgresql+psycopg2://postgres:ihatemoney@localhost:5432/ihatemoney_ci' || 'mysql+pymysql://root:ihatemoney@localhost:3306/ihatemoney_ci' }} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't find this very readable, what's wrong with the current approach? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add a comment there. It's just a different approach, that I find better because it has less repetition. I can surely add a comment here and format it better so it's easier to parse :-) |
||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install uv | ||
run: pip install uv | ||
- name: Build docs | ||
run: make build-docs |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
|
||
|
||
class TestAPI(IhatemoneyTestCase): | ||
|
||
"""Tests the API""" | ||
|
||
def api_create( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you remove this comment and the other ones below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure! (tbh I don't remember). Let's add them back.