Skip to content

Commit

Permalink
refactor: project to latest Debian image + Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
tomassebestik committed Feb 12, 2024
1 parent 50995e2 commit 27d40f1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.9
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.11

- name: Install dependencies
run: |
Expand Down
23 changes: 15 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
FROM node:18-bullseye-slim
FROM node:20-bookworm-slim

# Setting environment variables
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# Install Python and pip
# Install Python, venv, and other essentials
RUN : \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
python3.11 \
python3.11-venv \
python3-pip \
python3-setuptools \
&& pip3 install --no-cache-dir --upgrade pip \
&& rm -rf /var/lib/apt/lists/* \
&& :
&& rm -rf /var/lib/apt/lists/*

# Enable virtual environment for subsequent commands (safe for Debian BookWorm)
RUN python3.11 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip

# Install Python dependencies
COPY requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt

# Install Node.js dependencies
RUN npm i -g @shogobg/[email protected]

# Copy Python scripts
COPY sync_jira_actions/ /sync_jira_actions

# Define the entrypoint
ENTRYPOINT ["/usr/bin/python3", "/sync_jira_actions/sync_to_jira.py"]
# Define the entrypoint to use the virtual environment's Python interpreter
ENTRYPOINT ["/opt/venv/bin/python", "/sync_jira_actions/sync_to_jira.py"]
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
dynamic = ["version"]
name = "sync-jira-actions"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.11"

dependencies = ["PyGithub==2.2.0", "jira==3.6.0"]

Expand All @@ -33,14 +33,14 @@
[tool.ruff]
line-length = 120 # Specifies the maximum line length for ruff checks
select = ['E', 'F', 'W'] # Types of issues ruff should check for
target-version = "py39" # Specifies the target Python version for ruff checks
target-version = "py311" # Specifies the target Python version for ruff checks

[tool.mypy]
disallow_incomplete_defs = false # Disallows defining functions with incomplete type annotations
disallow_untyped_defs = false # Disallows defining functions without type annotations or with incomplete type annotations
exclude = '^venv/' # Paths to ignore during type checking
ignore_missing_imports = true # Suppress error messages about imports that cannot be resolved
python_version = "3.9" # Specifies the Python version used to parse and check the target program
python_version = "3.11" # Specifies the Python version used to parse and check the target program
warn_no_return = true # Shows errors for missing return statements on some execution paths
warn_return_any = true # Shows a warning when returning a value with type Any from a function declared with a non- Any return type

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --output-file=requirements.txt pyproject.toml
Expand Down

0 comments on commit 27d40f1

Please sign in to comment.