Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Pipenv -> Poetry #187

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/.env
/.docker-env
Dockerfile
Pipfile.log
poetry.log
/dist
.DS_Store
.idea
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ node_modules
/client/.cache
/client/dist
/saltdash/static
Pipfile.log
poetry.log
/dist
/build
3 changes: 0 additions & 3 deletions .pyup.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ ENV LANG C.UTF-8

ENV PATH="/root/.local/bin:${PATH}"
WORKDIR /code
RUN pip3 install --user pipenv shiv
RUN pip3 install --user poetry shiv
ADD . ./
COPY --from=build-node /code/client/dist/ ./client/dist
RUN set -ex && make setup && SECRET_KEY=s pipenv run saltdash collectstatic --noinput && make shiv
RUN set -ex && make setup && SECRET_KEY=s poetry run saltdash collectstatic --noinput && make shiv

FROM python:3.6-slim
COPY --from=build-python /code/dist /dist
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

26 changes: 12 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,37 @@ client-build: client-install
cd client; yarn run build

saltdash/static: client-build
SECRET_KEY=s pipenv run saltdash collectstatic --noinput
SECRET_KEY=s poetry run saltdash collectstatic --noinput

# Make will use the log file to determine if it is newer than Pipfile.lock
# Make will use the log file to determine if it is newer than poetry.lock
# and this should be rerun.
Pipfile.log: Pipfile.lock
pipenv install --deploy | tee $@
poetry.log: poetry.lock
poetry install | tee $@

.PHONY: setup
setup: Pipfile.log
setup: poetry.log

saltdash.yml: setup
pipenv run saltdash-generate-config > $@
poetry run saltdash-generate-config > $@

.PHONY: check
check: setup
pipenv run saltdash test
poetry run saltdash test

.PHONY: fmt
fmt:
isort -m=3 --trailing-comma --line-width=88 --atomic $(shell find saltdash -name '*.py' -not -path "*/migrations/*")
black $(shell find saltdash -name '*.py' -not -path "*/migrations/*")

version := $(shell python3 setup.py --version)
version := $(shell grep pyproject.toml -e '^version = ' | cut -f3 -d" " | tr -d '"')
platform := $(shell python3 -c "import sysconfig as sc; print('py{}-{}'.format(sc.get_python_version().replace('.', ''), sc.get_platform()))")
sha := $(shell git rev-parse HEAD)

dist:
mkdir $@

dist/saltdash-$(version)+$(sha)-$(platform).pyz: setup | dist
shiv -e saltdash:config.django_manage -o $@ \
--site-packages=$(shell pipenv --venv)/lib/python3.6/site-packages \
--no-deps .
shiv -e saltdash:config.django_manage -o $@ .

.PHONY: shiv
shiv: dist/saltdash-$(version)+$(sha)-$(platform).pyz
Expand All @@ -58,10 +56,10 @@ all: setup saltdash/static

.PHONY: release
release: clean all
pipenv run twine upload -s dist/*
poetry run twine upload -s dist/*

.PHONY: clean
clean:
rm -rf client/{node_modules,dist}
rm -rf saltdash/static dist saltdash.egg-info Pipfile.log
pipenv --rm || true
rm -rf saltdash/static dist poetry.log
# poetry env remove
17 changes: 0 additions & 17 deletions Pipfile

This file was deleted.

Loading