Skip to content

Commit

Permalink
Merge pull request #360 from freezingsaddles/obscurerichard/pyproject…
Browse files Browse the repository at this point in the history
…-toml-dependencies

Switch to pyproject.toml for dependencies
  • Loading branch information
obscurerichard authored Jan 1, 2025
2 parents f6c8243 + 27afc57 commit 3791508
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 104 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: isort Lint
uses: isort/isort-action@v1
with:
requirements-files: "requirements.txt requirements-test.txt"
requirements-files: "pyproject.toml"
- name: flake8 Lint
uses: py-actions/flake8@v2

Expand All @@ -38,7 +38,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-test.txt
pip install '.[dev]'
- name: djlint Lint
run: |
djlint --check freezing/web/templates
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ RUN apk update
RUN apk add py3-mysqlclient
RUN addgroup -S freezing && adduser -S -G freezing freezing
RUN pip3 install --upgrade pip
ADD requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
ADD . /app
RUN mkdir -p /data
COPY leaderboards /data/leaderboards
COPY alembic.ini /app
COPY pyproject.toml /app/
WORKDIR /app
RUN pip3 install .
ENV LEADERBOARDS_DIR=/data/leaderboards
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
recursive-include freezing/web/templates *
recursive-include freezing/web/static *
include requirements.txt
include requirements-test.txt
include setup.py
4 changes: 2 additions & 2 deletions freezing/web/templates/user/rides.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h2 class="clearfix">
}

function rideFormatter(value, row) {
return "<a href=\"https://www.strava.com/activities/"+row.id+"\">" + value + "</a>";
return `<a href="https://www.strava.com/activities/${row.id}">${value}</a>`;
}

function photosFormatter(value, row) {
Expand Down Expand Up @@ -197,7 +197,7 @@ <h2 class="clearfix">

function refetchFormatter(value, row) {
if (row.photos_fetched) {
return "<a href=\"#\" onclick=\"refetchPhotosForRide("+value+")\">refetch</a>";
return `<a href="#" onclick="refetchPhotosForRide(${value})">refetch</a>`;
}
}

Expand Down
67 changes: 67 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "freezing-web"
version = "1.6.0"
description = "Freezing Saddles website component."
authors = [
{name = "Hans Lellelid", email = "[email protected]"},
{name = "Ian Will"},
{name = "Jon Renaut"},
{name = "Merlin Hughes"},
{name = "Richard Bullington-McGuire", email = "[email protected]"},
{name = "Adrian Porter"},
{name = "Joe Tatsuko"}
]
license = {text = "Apache License (2.0)"}
dependencies = [
"Flask==3.1.0",
"GeoAlchemy2==0.16.0",
"PyMySQL[rsa]==1.1.1",
"PyYAML==6.0.2",
"SQLAlchemy==1.4.54",
# Thanks https://stackoverflow.com/a/77214086/424301 - Flask did not pin Werkzeug dep
"Werkzeug==3.1.3",
"arrow==0.15.5",
"autoflake==2.3.1",
"beautifulsoup4==4.12.3",
"colorlog==4.1.0",
"envparse==0.2.0",
"freezing-model @ https://github.com/freezingsaddles/freezing-model/archive/0.10.4.tar.gz",
"gunicorn==23.0.0",
"marshmallow==3.23.2",
"marshmallow-enum @ https://github.com/lyft/marshmallow_enum/archive/support-for-marshamallow-3.tar.gz",
"python-instagram==1.3.2",
"pytz==2024.2",
"stravalib==1.2.0",
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: Apache Software License",
"Topic :: Games",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Natural Language :: English",
]

[project.optional-dependencies]
dev = [
"bandit",
"black",
"djlint",
"flake8",
"isort",
"pymarkdownlnt"
]

[tool.isort]
profile = "black"

Expand All @@ -8,3 +68,10 @@ max_line_length=88
[tool.pymarkdown]
plugins.md013.enabled = false
extensions.front-matter.enabled = true

[tool.setuptools]
# Thanks https://stackoverflow.com/a/72547402/424301
py-modules = ["freezing"]

[project.scripts]
freezing-server = "freezing.web.runserver:main"
7 changes: 0 additions & 7 deletions requirements-test.txt

This file was deleted.

19 changes: 0 additions & 19 deletions requirements.txt

This file was deleted.

69 changes: 0 additions & 69 deletions setup.py

This file was deleted.

0 comments on commit 3791508

Please sign in to comment.