Skip to content

Commit

Permalink
chore: add pipcompile command (#1646)
Browse files Browse the repository at this point in the history
* chore: add pipcompile command

* Update dev

Co-authored-by: Rafał Pitoń <[email protected]>

* fix: dispatch pipcompile command

---------

Co-authored-by: Rafał Pitoń <[email protected]>
  • Loading branch information
garguelles and rafalp authored Oct 21, 2023
1 parent a2e37a7 commit 83af169
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ RUN apt-get update && apt-get install -y \
postgresql-client \
gettext

# Install pip-tools
RUN python -m pip install pip-tools

# Add requirements and install them. We do this unnecessasy rebuilding.
ADD requirements.txt /
ADD requirements-plugins.txt /
Expand Down
8 changes: 8 additions & 0 deletions dev
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ intro() {
echo " ${BOLD}pyfmt${NORMAL} runs isort + black on python code."
echo " ${BOLD}fakedata${NORMAL} populates database with testing data."
echo " ${BOLD}fakebigdata${NORMAL} populates database with LARGE amount of testing data."
echo " ${BOLD}pipcompile${NORMAL} run pip-compile to update requirements.txt"
echo
}

Expand Down Expand Up @@ -312,6 +313,11 @@ create_fake_bigdata() {
docker compose run --rm misago python manage.py createfakehistory 2190 120
}

# Shortcut for pip compile new requirements.txt
pip_compile() {
docker compose run --rm misago pip-compile --output-file=requirements.txt requirements.in
}

# Command dispatcher
if [[ $1 ]]; then
if [[ $1 = "init" ]]; then
Expand Down Expand Up @@ -363,6 +369,8 @@ if [[ $1 ]]; then
create_fake_data
elif [[ $1 = "fakebigdata" ]]; then
create_fake_bigdata
elif [[ $1 = "pipcompile" ]]; then
pip_compile
else
invalid_argument $1
fi
Expand Down

0 comments on commit 83af169

Please sign in to comment.