Skip to content
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

packaging: Add support for pdm #231

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
040ad51
:zap: Update README with the recent activity
github-actions[bot] Apr 12, 2024
6796282
:zap: Update README with the recent activity
github-actions[bot] Apr 13, 2024
5089cfa
:zap: Update README with the recent activity
github-actions[bot] Apr 14, 2024
2aacf91
:zap: Update README with the recent activity
github-actions[bot] Apr 15, 2024
7e18a5e
:zap: Update README with the recent activity
github-actions[bot] Apr 16, 2024
4c3e75b
:zap: Update README with the recent activity
github-actions[bot] Apr 17, 2024
cae9498
:zap: Update README with the recent activity
github-actions[bot] Apr 18, 2024
ae29228
:zap: Update README with the recent activity
github-actions[bot] Apr 19, 2024
326da3d
:zap: Update README with the recent activity
github-actions[bot] Apr 20, 2024
4f857c1
:zap: Update README with the recent activity
github-actions[bot] Apr 21, 2024
bb8509b
:zap: Update README with the recent activity
github-actions[bot] Apr 23, 2024
e9d0c2c
:zap: Update README with the recent activity
github-actions[bot] Apr 24, 2024
f0163a1
:zap: Update README with the recent activity
github-actions[bot] Apr 25, 2024
d399230
:zap: Update README with the recent activity
github-actions[bot] Apr 26, 2024
a6d506a
:zap: Update README with the recent activity
github-actions[bot] Apr 27, 2024
93102cf
:zap: Update README with the recent activity
github-actions[bot] Apr 28, 2024
85e954f
:zap: Update README with the recent activity
github-actions[bot] Apr 29, 2024
f84fee5
Merge branch 'pep8speaks-org:master' into master
Mr-Sunglasses Apr 29, 2024
36ea47f
:zap: Update README with the recent activity
github-actions[bot] Apr 30, 2024
17341ed
Merge branch 'pep8speaks-org:master' into master
Mr-Sunglasses Apr 30, 2024
b2c7e4b
:sparkles: Feat: Add pdm support
Mr-Sunglasses Apr 30, 2024
23e2a3f
:zap: Feat: Add pdm to Docker
Mr-Sunglasses Apr 30, 2024
23e05bc
:mute: Deps: Remove requirements.txt
Mr-Sunglasses Apr 30, 2024
d1f2a6c
:bug: Fix: Port number in dockerfile
Mr-Sunglasses Apr 30, 2024
261cca1
:memo: Chore: Add @tushar5526 as coauthor
Mr-Sunglasses Apr 30, 2024
833300f
:green_heart: Feat: Actions to update deps
Mr-Sunglasses Apr 30, 2024
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
17 changes: 17 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Update dependencies

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
update-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Update dependencies
uses: pdm-project/update-deps-action@main
with:
install-plugins: 'true'
23 changes: 11 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# Use an official Python runtime as a parent image
FROM python:3.8-alpine

# Set the working directory to /app
WORKDIR /app
# install PDM
RUN pip install -U pip setuptools wheel
RUN pip install pdm

# Copy the current directory contents into the container at /app
COPY requirements /app/requirements
COPY requirements.txt /app/requirements.txt
# copy files
COPY pyproject.toml pdm.lock README.md /project/

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY . /project

COPY pep8speaks /app/pep8speaks
COPY server.py /app/server.py
COPY data /app/data

# Expose port 8000 for the Gunicorn server to listen on
WORKDIR /project

RUN pdm install

EXPOSE 8000

# Define the command to run your application using Gunicorn
CMD ["gunicorn", "server:app", "--bind", "0.0.0.0:8000", "--workers", "4"]
CMD ["pdm", "run", "start"]
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
image: pep8speaks
ports:
- ${SERVICE_PORT-8000}:8000
command: [ "gunicorn", "server:app", "--bind", "0.0.0.0:8000", "--workers", "4" ]
command: ["pdm", "run", "start"]
environment:
APP_SECRET_KEY: ${APP_SECRET_KEY-secret_key}
GITHUB_TOKEN: ${GITHUB_TOKEN}
Expand Down
556 changes: 556 additions & 0 deletions pdm.lock

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[project]
name = ""
version = ""
description = ""
authors = [
{name = "Kanishk Pachauri", email = "[email protected]"},
{name = "Tushar Gupta", email = "[email protected]"},
]
dependencies = [
"requests>=2.31.0",
"flask>=3.0.0",
"gunicorn>=21.2.0",
"pycodestyle>=2.11.1",
"flake8>=6.1.0",
"PyYAML>=6.0.1",
"unidiff>=0.7.5",
"autopep8>=2.0.4",
"markdown>=3.5.1",
"beautifulsoup4>=4.12.2",
"markupsafe>=2.1.3",
"python-dotenv>=1.0.0",
]
requires-python = ">=3.9"
readme = "README.md"
license = {text = "MIT"}
[tool.pdm.dev-dependencies]
test = [
"pytest>=7.4.3",
"pytest-flask>=1.3.0",
"pytest-mock>=3.12.0",
"mock>=5.1.0",
]
pytest = []
pytest-flask = []
pytest-mock = []
mock = []
[tool.pdm.scripts]
start = "gunicorn server:app --bind 0.0.0.0:8000 --workers 4"
dev = "python3 server.py"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

12 changes: 0 additions & 12 deletions requirements/base.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/test.txt

This file was deleted.