Skip to content

Commit

Permalink
Switch to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyfedoseev committed Aug 21, 2023
1 parent 7abbc54 commit 9b9ba02
Show file tree
Hide file tree
Showing 9 changed files with 680 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test_project/db.sqlite3
/docs/_build/
/docs/_static/
/docs/_templates/
coverage.xml
*.sublime-*
.venv
.pytest_cache
__pycache__/
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN apt update && \
apt install software-properties-common -y && \
add-apt-repository ppa:deadsnakes/ppa -y && \
apt install -y \
python3-venv \
python3.8-dev \
python3.9-dev \
python3.9-distutils \
Expand All @@ -16,9 +17,14 @@ RUN apt update && \
python3.12-distutils \
python3-pip \
sqlite3
ENV POETRY_HOME=/opt/poetry VIRTUAL_ENV=/opt/venv PATH=/opt/venv/bin:/opt/poetry/bin:$PATH
RUN python3 -m venv $POETRY_HOME && \
$POETRY_HOME/bin/pip install --upgrade pip && \
$POETRY_HOME/bin/pip install poetry && \
python3 -m venv $VIRTUAL_ENV
RUN mkdir /app
WORKDIR /app
ADD requirements-*.txt /app/
RUN pip3 install -r requirements-test.txt
ADD poetry.lock pyproject.toml /app/
RUN poetry install --all-extras --no-root --no-interaction
ADD . /app/
RUN pip3 install .[libsass]
RUN poetry install --all-extras --no-interaction
10 changes: 0 additions & 10 deletions MANIFEST.in

This file was deleted.

14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
all:
docker-compose build
docker compose build

shell:
docker-compose run --rm app /bin/bash
docker compose run --rm app /bin/bash

test:
docker-compose run --rm app tox
docker compose run --rm app tox -p auto

mypy:
docker-compose run --rm app mypy --strict ./src
docker compose run --rm app mypy --strict ./src

package:
rm -rf ./dist
python3 -m build
poetry build

test-publish: package
twine upload --repository testpypi dist/*
poetry publish -r testpypi

publish: package
twine upload dist/*
poetry publish

pre-commit:
pre-commit run -a
596 changes: 596 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

63 changes: 61 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
[tool.poetry]
name = "django-static-precompiler"
version = "3.0a1"
description = "Django template tags to compile all kinds of static files (SASS, LESS, Stylus, CoffeeScript, Babel, LiveScript, Handlebars)."
authors = ["Andrey Fedoseev <[email protected]>"]
license = "MIT"
readme = ["README.md", "CHANGES.md"]
homepage = "https://github.com/andreyfedoseev/django-static-precompiler"
repository = "https://github.com/andreyfedoseev/django-static-precompiler"
documentation = "https://django-static-precompiler.readthedocs.io/"
keywords = ["django", "sass", "scss"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Django :: 3",
"Framework :: Django :: 4",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP"
]
packages = [
{include = "static_precompiler", from = "src"}
]
include = [
"AUTHORS",
"README.md",
"CHANGES.md",
"LICENSE",
"py.typed",
{ path = "tests", format = "sdist" }
]

[tool.poetry.dependencies]
python = "^3.8"
Django = "^3.2.0"
libsass = {version = "*", optional = true}
watchdog = {version = "*", optional = true}

[tool.poetry.group.test.dependencies]
pytest = "~7.4.0"
pytest-django = "~4.5.0"
pretend = "~1.0.9"
libsass = "~0.22.0"
pytest-cov = "~4.0.0"
watchdog = "~3.0.0"
coverage = "~7.3.0"
tox = "~4.9.0"
mypy = "~1.4.0"
django-stubs = {extras = ["compatible-mypy"], version = "~4.2.3"}

[tool.poetry.extras]
libsass = ["libsass"]
watchdog = ["watchdog"]

[build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 120
Expand Down
12 changes: 0 additions & 12 deletions requirements-test.txt

This file was deleted.

65 changes: 0 additions & 65 deletions setup.cfg

This file was deleted.

12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[tox]
isolated_build = True
isolated_build = true
envlist =
py38-django32,
py39-django42
py310-django42
py311-django42
py312-django42

[testenv]
passenv = GEM_PATH
allowlist_externals = poetry
deps =
-rrequirements-test.txt
django32: Django>=3.2,<4
django42: Django>=4.2,<4.3
commands = pytest --cov static_precompiler --cov-report xml --cov-append
setenv =
PYTHONPATH = {toxinidir}
commands_pre =
poetry install --all-extras
commands = poetry run pytest --cov static_precompiler --cov-report xml --cov-append

0 comments on commit 9b9ba02

Please sign in to comment.