Skip to content

Commit

Permalink
feat!: use poetry for building and update os to ubi9-minimal
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare committed Jan 29, 2023
1 parent 777ac82 commit 48361e3
Show file tree
Hide file tree
Showing 10 changed files with 1,049 additions and 69 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,5 @@ on:
jobs:
call-workflow:
uses: radiorabe/actions/.github/workflows/test-pre-commit.yaml@main
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.x', '3.9' ]
name: Test python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Test
run: |
pytest --cov=app --cov-report=term --cov-fail-under=100
call-workflow:
uses: radiorabe/actions/.github/workflows/test-python-poetry.yaml@main
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ __pycache__
/cov/
/.coverage
/node_modules/
venv/
3 changes: 3 additions & 0 deletions .semrelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"maintainedVersion": "2-alpha"
}
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
FROM ghcr.io/radiorabe/s2i-python:1.0.2 AS build
FROM ghcr.io/radiorabe/s2i-python:2.0.0-alpha.2 AS build

COPY --chown=1001:0 ./ /opt/app-root/src/

RUN npm install \
&& cp node_modules/typeface-fjalla-one/files/fjalla-one-* app/static/ \
&& python3 setup.py bdist_wheel
&& cp node_modules/typeface-fjalla-one/files/fjalla-one-* app/static/

RUN python3 -mbuild

FROM ghcr.io/radiorabe/python-minimal:1.0.2 AS app

FROM ghcr.io/radiorabe/python-minimal:2.0.0-alpha.4 AS app

COPY --from=build /opt/app-root/src/dist/*.whl /tmp/dist/

RUN python3 -mpip --no-cache-dir install /tmp/dist/*.whl \
RUN microdnf install -y \
python3-pip \
&& python3 -mpip --no-cache-dir install /tmp/dist/*.whl \
&& microdnf remove -y \
python3-pip \
python3-setuptools \
&& microdnf clean all \
&& rm -rf /tmp/dist/

USER nobody
Expand Down
976 changes: 976 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[tool.poetry]
name = "cat-page"
version = "0.0.0" # 0.0.0 placeholder is replaced on release
description = "RaBe Cat Landing Page"
repository = "https://github.com/radiorabe/cat-page"
authors = ["RaBe IT-Reaktion <[email protected]>"]
license = "AGPL-3"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Software Development :: Libraries :: Python Modules",
]
readme = "README.md"
packages = [
{ include = "app"},
]

[tool.poetry.scripts]
catpage = 'app.server:main'

[tool.poetry.dependencies]
python = "^3.9"
Werkzeug = "^2.2.2"
Jinja2 = "^3.1.2"
configargparse = "^1.5.3"
CherryPy = "^18.8.0"
cachelib = "^0.9.0"

[tool.poetry.dev-dependencies]
black = "^22.12.0"
flake8 = "^6.0.0"
flake8-debugger = "^4.1.2"
flake8-docstrings = "^1.6.0"
flake8-isort = "^5.0.3"
flake8-string-format = "^0.3.0"
flake8-tuple = "^0.4.1"
isort = "^5.10.1"
pydocstyle = "^6.1.1"
pytest = "^7.2.0"
pytest-cov = "^4.0.0"

[tool.isort]
line_length = 120
profile = "black"

[tool.pytest.ini_options]
minversion = "7.2"
addopts = "-ra -q --random-order --doctest-glob='*.md' --doctest-modules --cov=cridlib --cov-fail-under=100 --pylint --mypy"
filterwarnings = ["ignore::pytest.PytestRemovedIn8Warning:pytest_pylint"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
12 changes: 0 additions & 12 deletions requirements-dev.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

0 comments on commit 48361e3

Please sign in to comment.