Skip to content

Commit

Permalink
Merge branch 'pixi-pyroject' into 'main'
Browse files Browse the repository at this point in the history
pixi with pyroject

See merge request johndutchover/short-circuit-me!6
  • Loading branch information
John Dutchover committed Mar 8, 2024
2 parents 84ce0a6 + cb055ea commit f6214bd
Show file tree
Hide file tree
Showing 10 changed files with 3,410 additions and 1,699 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
jobs:
tests:
name: Test ${{ matrix.environment }}
runs-on: ubuntu-latest
strategy:
matrix:
environment:
- pl017
- pl018
- pl019
- pl020
- py39
- py310
- py311
- py312
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
# already installs the corresponding environment and caches it
environments: ${{ matrix.environment }}
- name: Install dependencies
run: |
pixi run --env ${{ matrix.environment }} postinstall
pixi run --env ${{ matrix.environment }} test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,7 @@ secrets.toml
# fly ssh keys
id
id-cert.pub
# test report
report.md
# End of project exclusions
.pixi/*
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

3 changes: 3 additions & 0 deletions backend/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML

3 changes: 3 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pixi environments
.pixi

27 changes: 17 additions & 10 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
# syntax=docker/dockerfile:1
FROM python:3.10.13-slim-bookworm
FROM python:3.12-slim-bookworm
WORKDIR /app
ENV PIXI_VERSION=latest
ENV INSTALL_DIR=/usr/local/bin
ENV REPO=prefix-dev/pixi
ENV PLATFORM=unknown-linux-musl
ENV PROJECT_NAME=pixi-in-docker
ENV PYTHONPATH /app

# Install apt-utils first to avoid debconf warning
RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-utils \
&& apt-get install -y --no-install-recommends apt-utils curl tar \
&& apt-get upgrade -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Copy the necessary files from the repository root
COPY .env pyproject.toml poetry.lock /app/
# Download and install pixi
RUN if [ "$PIXI_VERSION" = "latest" ]; then \
DOWNLOAD_URL="https://github.com/$REPO/releases/latest/download/pixi-$(uname -m)-$PLATFORM.tar.gz"; \
else \
DOWNLOAD_URL="https://github.com/$REPO/releases/download/$PIXI_VERSION/pixi-$(uname -m)-$PLATFORM.tar.gz"; \
fi && \
curl -SL "$DOWNLOAD_URL" | tar -xz -C "$INSTALL_DIR"

# Install poetry and project dependencies, upgrade pip first
RUN pip install --upgrade pip \
&& pip install --no-cache-dir poetry \
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
# Copy the necessary files from the repository root
COPY ../pixi.toml ../pixi.lock ../pyproject.toml backend/.env /app/

# Copy the application-specific files from the backend subdirectory
COPY backend/slackbolt_api.py backend/start_bolt.sh /app/

EXPOSE 3000

ENTRYPOINT ["sh", "/app/start_bolt.sh"]
ENTRYPOINT ["pixi", "run", "-e", "prod", "start-d"]
3,296 changes: 3,296 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[project]
name = "scm-backend"
version = "0.1.0"
description = "Add a short description here"
authors = ["John Dutchover <[email protected]>"]
channels = ["conda-forge"]
platforms = ["linux-aarch64", "osx-64", "osx-arm64"]

[tasks]
postinstall-e = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ."
postinstall = "pip install --no-build-isolation --no-deps --disable-pip-version-check ."
start-d = { cmd = "python slackbolt_api.py" }
start = { cmd = "python slackbolt_api.py", cwd = "backend" }

[dependencies]
python = ">3.10,<=3.12"
anyio = ">=3.7.1,<3.8"
fastapi = ">=0.110.0,<0.111"
slack-bolt = ">=1.18.1,<1.19"
pydantic = ">=2.6.3,<2.7"
uvicorn = ">=0.27.1,<0.28"
requests = ">=2.31.0,<2.32"
numpy = ">=1.26.4,<1.27"
motor = ">=3.3.2,<3.4"
dnspython = ">=2.6.1,<2.7"
aiohttp = ">=3.9.3,<3.10"
typing-extensions = ">=4.10.0,<4.11"
watchdog = ">=4.0.0,<4.1"

[host-dependencies]
python = "*"
pip = "*"

[feature.test.dependencies]
pytest = "*"
pytest-md = "*"
pytest-asyncio = "*"
typer = ">=0.9.0"
flake8 = ">=6.0.0"
black = ">=23.3.0"
pylint = ">=2.17.4"
gitpython = ">=3.1.35"
packaging = ">=22.0"

[feature.test.tasks]
test = "pytest --md=report.md"

[environments]
default = {features = ["test"], solve-group = "prod-group"}
prod = {features = [], solve-group = "prod-group"}

[pypi-dependencies]
load-dotenv = "*"
1,644 changes: 0 additions & 1,644 deletions poetry.lock

This file was deleted.

54 changes: 10 additions & 44 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,45 +1,11 @@
[tool.poetry]
[project]
name = "short-circuit-me"
version = "0.6.1"
description = "short-circuit-me poetry"
authors = ["John Dutchover <[email protected]>"]
readme = ["README.md", "backend/backend.README.md"]
packages = [
{ include = "backend" },
]

[tool.poetry.dependencies]

[tool.poetry.group.backend]

[tool.poetry.group.backend.dependencies]
anyio = {version = ">=4.0.0", python=">=3.10"}
fastapi = {version = ">=0.103.0", python=">=3.10"}
slack-bolt = {version = "^1.18.0", python=">=3.10"}
python-dotenv = {version = "^1.0.0", python=">=3.10"}
pydantic = {version = ">=1.8.0", python=">=3.10"}
uvicorn = { version = ">=0.23.0", python=">=3.10"}
requests = { version = ">=2.3.0", python=">=3.10"}
watchdog = { version = "^3.0.0", python = ">=3.10" }
asyncio = "^3.4.3"
numpy = {version = "^1.24.3", python = ">=3.10"}
motor = {version = "^3.1.2", python=">=3.10"}
load-dotenv = "^0.1.0"
dnspython = {version = "^2.3.0", python=">=3.10,<4.0"}
aiohttp = {version = ">=3.8.5", python=">=3.10"}
typing-extensions = {version = ">=4.8.0", python = ">=3.10"}

[tool.poetry.group.dev.dependencies]
typer = { version = "^0.9.0", python = ">=3.10" }
flake8 = { version = "^6.0.0", python=">=3.10"}
black = { version = "^23.3.0", python=">=3.10"}
pylint = { version = "^2.17.4", python=">=3.10"}
gitpython = { version = ">=3.1.35", python = ">3.10" }
packaging = { version = ">=22.0", python = "3.10" }

[tool.poetry.group.test.dependencies]
pytest = { version = ">=7.4.4", python = ">=3.10" }

[build-system]
requires = ["poetry-core", "setuptools-scm"]
build-backend = "poetry.core.masonry.api"
dynamic = ["version"]
description = "short-circuit-me"
authors = [
{name = "John Dutchover", email = "[email protected]"}
]
readme = {file = "README.md", content-type = "text/markdown"}

[tool.setuptools]
packages = ["assets", "backend"]

0 comments on commit f6214bd

Please sign in to comment.