Skip to content

Commit

Permalink
Merge pull request #103 from niltonpimentel02/feature/#99
Browse files Browse the repository at this point in the history
feat: add uv and update github actions
  • Loading branch information
bbelderbos authored Oct 31, 2024
2 parents 21d0931 + 57d12e3 commit d1e5e9b
Show file tree
Hide file tree
Showing 5 changed files with 1,000 additions and 75 deletions.
53 changes: 23 additions & 30 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,28 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: pytest
env:
SECRET_KEY: 21290asdkja
DEBUG: True
DATABASE_URL: sqlite:///test.db
ENV: local
ALLOWED_HOSTS: localhost
SENDGRID_API_KEY: 123
FROM_EMAIL: [email protected]
ADMIN_USERS: pybites
CELERY_BROKER_URL: amqp://guest:guest@localhost
- uses: actions/checkout@v4

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

- name: Set up Python
run: uv python install 3.12

- name: Install the project
run: uv sync

- name: Run tests
run: uv run pytest
env:
SECRET_KEY: 21290asdkja
DEBUG: True
DATABASE_URL: sqlite:///test.db
ENV: local
ALLOWED_HOSTS: localhost
SENDGRID_API_KEY: 123
FROM_EMAIL: [email protected]
ADMIN_USERS: pybites
CELERY_BROKER_URL: amqp://guest:guest@localhost
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
[project]
name = "pybitesbooks"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"celery==5.2.7",
"dj-database-url==1.0.0",
"django-debug-toolbar==3.7.0",
"django-registration==3.3",
"django==4.1.13",
"gunicorn==22.0.0",
"pre-commit==4.0.0",
"psycopg2-binary==2.9.5",
"pytest-cov==4.0.0",
"pytest-django==4.5.2",
"pytest==7.2.0",
"python-decouple==3.6",
"redis==4.5.4",
"requests==2.32.0",
"sendgrid==6.9.7",
"sentry-sdk==2.8.0",
"toml==0.10.2",
"whitenoise==6.2.0",
]

[tool.ruff]
# In addition to the standard set of exclusions, omit all tests, plus a specific file.
extend-exclude = [
Expand Down
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ sendgrid==6.9.7
sentry-sdk==2.8.0
toml==0.10.2
whitenoise==6.2.0
pre_commit==4.0.0
114 changes: 69 additions & 45 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
#
# This file is autogenerated by pip-compile with python 3.11
# To update, run:
#
# pip-compile
#
amqp==5.0.9
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in --output-file requirements.txt
amqp==5.2.0
# via kombu
asgiref==3.5.2
asgiref==3.8.1
# via django
async-timeout==4.0.2
async-timeout==4.0.3
# via redis
attrs==20.2.0
attrs==24.2.0
# via pytest
billiard==3.6.4.0
# via celery
build==0.9.0
build==1.2.2.post1
# via pip-tools
celery==5.2.7
# via -r requirements.in
certifi==2024.7.4
certifi==2024.8.30
# via
# requests
# sentry-sdk
charset-normalizer==2.1.1
cfgv==3.4.0
# via pre-commit
charset-normalizer==3.4.0
# via requests
click==8.0.3
click==8.1.7
# via
# celery
# click-didyoumean
# click-plugins
# click-repl
# pip-tools
click-didyoumean==0.0.3
click-didyoumean==0.3.1
# via celery
click-plugins==1.1.1
# via celery
click-repl==0.2.0
click-repl==0.3.0
# via celery
confusable-homoglyphs==3.2.0
confusable-homoglyphs==3.3.1
# via django-registration
coverage[toml]==6.5.0
coverage==7.6.4
# via pytest-cov
distlib==0.3.9
# via virtualenv
dj-database-url==1.0.0
# via -r requirements.in
django==4.1.13
Expand All @@ -53,32 +53,45 @@ django-debug-toolbar==3.7.0
# via -r requirements.in
django-registration==3.3
# via -r requirements.in
exceptiongroup==1.2.2
# via pytest
filelock==3.16.1
# via virtualenv
gunicorn==22.0.0
# via -r requirements.in
idna==3.7
identify==2.6.1
# via pre-commit
idna==3.10
# via requests
iniconfig==1.1.1
importlib-metadata==8.5.0
# via build
iniconfig==2.0.0
# via pytest
kombu==5.2.3
kombu==5.4.2
# via celery
packaging==20.4
nodeenv==1.9.1
# via pre-commit
packaging==24.1
# via
# build
# gunicorn
# pytest
pep517==0.13.0
# via build
pip==24.3.1
# via pip-tools
pip-tools==6.10.0
# via -r requirements.in
pluggy==0.13.1
platformdirs==4.3.6
# via virtualenv
pluggy==1.5.0
# via pytest
pre_commit==4.0.0
prompt-toolkit==3.0.20
pre-commit==4.0.0
# via -r requirements.in
prompt-toolkit==3.0.48
# via click-repl
psycopg2-binary==2.9.5
# via -r requirements.in
pyparsing==2.4.7
# via packaging
pyproject-hooks==1.2.0
# via build
pytest==7.2.0
# via
# -r requirements.in
Expand All @@ -90,10 +103,12 @@ pytest-django==4.5.2
# via -r requirements.in
python-decouple==3.6
# via -r requirements.in
python-http-client==3.3.1
python-http-client==3.3.7
# via sendgrid
pytz==2022.6
pytz==2024.2
# via celery
pyyaml==6.0.2
# via pre-commit
redis==4.5.4
# via -r requirements.in
requests==2.32.0
Expand All @@ -102,34 +117,43 @@ sendgrid==6.9.7
# via -r requirements.in
sentry-sdk==2.8.0
# via -r requirements.in
six==1.15.0
# via
# click-repl
# packaging
sqlparse==0.5.0
setuptools==75.3.0
# via pip-tools
sqlparse==0.5.1
# via
# django
# django-debug-toolbar
starkbank-ecdsa==2.0.1
starkbank-ecdsa==2.2.0
# via sendgrid
toml==0.10.2
# via -r requirements.in
urllib3==1.26.19
tomli==2.0.2
# via
# build
# coverage
# pytest
typing-extensions==4.12.2
# via
# asgiref
# kombu
tzdata==2024.2
# via kombu
urllib3==2.2.3
# via
# requests
# sentry-sdk
vine==5.0.0
vine==5.1.0
# via
# amqp
# celery
# kombu
wcwidth==0.2.5
virtualenv==20.27.1
# via pre-commit
wcwidth==0.2.13
# via prompt-toolkit
wheel==0.38.4
wheel==0.44.0
# via pip-tools
whitenoise==6.2.0
# via -r requirements.in

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
zipp==3.20.2
# via importlib-metadata
Loading

0 comments on commit d1e5e9b

Please sign in to comment.