Skip to content

Commit

Permalink
✨ python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin committed Dec 15, 2023
1 parent 283df1a commit b1cc3ed
Show file tree
Hide file tree
Showing 16 changed files with 1,558 additions and 1,214 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python Environment 3.10
- name: Set up Python Environment 3.11
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install Hatch
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Set up Python Environment
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install Hatch
working-directory: ${{ github.workspace }}/main
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
fail-fast: true
matrix:
include:
- {name: Python 3.12, python: '3.12'}
- {name: Python 3.11, python: '3.11'}
- {name: Python 3.10, python: '3.10'}
- {name: Python 3.9, python: '3.9'}
Expand All @@ -40,12 +41,11 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch -v env create
hatch --version
- name: Test Suite
run: |
echo "::add-matcher::.github/matchers/python.json"
hatch run test
hatch run +py=${{ matrix.python }} test:test
echo "::remove-matcher owner=python::"
env:
VCR_RECORD_MODE: none
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-python:3.10-slim}
FROM ${BASE_IMAGE:-python:3.11-slim}

MAINTAINER Justin Flannery "[email protected]"

RUN python -m pip install --upgrade pip
COPY pyproject.toml README.md /tmp/lunchable/
COPY lunchable/ /tmp/lunchable/lunchable/
COPY requirements/prod.txt /tmp/lunchable/requirements.txt
COPY requirements/requirements-prod.txt /tmp/lunchable/requirements.txt
RUN pip install -r /tmp/lunchable/requirements.txt
RUN pip install /tmp/lunchable/[all] && rm -rf /tmp/lunchable

Expand Down
32 changes: 16 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
]
dependencies = [
"click>=8.0.1",
Expand All @@ -30,18 +31,18 @@ requires-python = ">=3.8,<4"

[project.optional-dependencies]
all = [
"pandas>=1.5.0,<2.0.0",
"python-dateutil~=2.8.2",
"pandas",
"python-dateutil",
"splitwise>=2.3.0,<3.0.0"
]
apps = [
"pandas>=1.5.0,<2.0.0"
"pandas"
]
primelunch = [
"pandas>=1.5.0,<2.0.0"
"pandas"
]
splitlunch = [
"python-dateutil~=2.8.2",
"python-dateutil",
"splitwise>=2.3.0,<3.0.0"
]

Expand All @@ -64,6 +65,11 @@ branch = true
omit = ["lunchable/_version.py"]
parallel = true

[tool.hatch.env]
requires = [
"hatch-pip-compile"
]

[tool.hatch.envs.default]
dependencies = [
# Testing
Expand Down Expand Up @@ -92,6 +98,7 @@ dependencies = [
features = [
"all"
]
type = "pip-compile"

[tool.hatch.envs.default.env-vars]
LUNCHMONEY_ACCESS_TOKEN = "{env:LUNCHMONEY_ACCESS_TOKEN:LUNCHMONEY_ACCESS_TOKEN_PLACEHOLDER}"
Expand All @@ -102,8 +109,7 @@ SPLITWISE_CONSUMER_KEY = "{env:SPLITWISE_CONSUMER_KEY:SPLITWISE_CONSUMER_KEY_PLA
SPLITWISE_CONSUMER_SECRET = "{env:SPLITWISE_CONSUMER_SECRET:SPLITWISE_CONSUMER_SECRET_PLACEHOLDER}"

[tool.hatch.envs.default.scripts]
_pip_compile = "pip-compile --resolver=backtracking --generate-hashes --all-extras {args:}"
_sed_requirements = "sed -i.bak 's/-r requirements.in/lunchable (pyproject.toml)/' {args}"
_pip_compile = "pip-compile --resolver=backtracking --all-extras {args:}"
all = ["format", "lint", "test"]
check = [
"""
Expand All @@ -127,13 +133,7 @@ docs-serve = [
format = ["ruff --fix {args:.}", "black {args:.}"]
lint = ["ruff {args:.}", "black --check {args:.}"]
requirements = [
"hatch dep show requirements --project-only --all > requirements.in",
"_pip_compile --output-file requirements/prod.txt{args:}",
"_sed_requirements requirements/prod.txt",
"hatch dep show requirements --all > requirements.in",
"_pip_compile --output-file requirements/dev.txt{args:}",
"_sed_requirements requirements/dev.txt",
"rm requirements.in"
"_pip_compile --output-file requirements/requirements-prod.txt {args:}"
]
semantic-release = [
"npm install --prefix .github/semantic_release/",
Expand All @@ -142,7 +142,7 @@ semantic-release = [
test = "pytest --cov=lunchable --cov-report={env:COVERAGE_REPORT:term-missing} --cov-config=pyproject.toml {args:tests/ -v}"

[[tool.hatch.envs.test.matrix]]
python = ["3.8", "3.9", "3.10", "3.11"]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.test.scripts]
matrix = "test"
Expand Down
Loading

0 comments on commit b1cc3ed

Please sign in to comment.