diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8e90bd..42ed1d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: - name: Setup dependencies if: steps.dep-cache.outputs.cache-hit != 'true' run: | - . script/bootstrap + . script/bootstrap.sh test: runs-on: ubuntu-latest needs: setup @@ -45,7 +45,7 @@ jobs: ./slack-status-cli.venv - name: Setup dependencies run: | - . script/bootstrap + . script/bootstrap.sh - name: Tests run: | python -m pytest --cov-report xml --cov=slack_status_cli -s @@ -86,7 +86,7 @@ jobs: ./slack-status-cli.venv - name: Setup dependencies run: | - . script/bootstrap + . script/bootstrap.sh - name: Lint and format run: | python -m pylint **/*.py diff --git a/pyproject.toml b/pyproject.toml index 17df8a8..44af02f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,8 @@ version = "0.1.0" description = "Tooling to set your Slack status on the fly without having to click around" requires-python = ">=3.8" readme = "README.md" +dependencies = [] + [[project.authors]] name = "Marc Cataford" email = "mcat@riseup.net" @@ -12,5 +14,16 @@ email = "mcat@riseup.net" Homepage = "https://github.com/mcataford/slack-status-cli" "Bug Tracker" = "https://github.com/mcataford/slack-status-cli/issues" +[project.optional-dependencies] +dev = [ + "build", + "toml", + "pytest", + "black", + "pylint", + "pytest-cov", + "syrupy", +] + [tool.setuptools] packages = [ "slack_status_cli",] diff --git a/requirements.in b/requirements.in deleted file mode 100644 index e69de29..0000000 diff --git a/requirements.txt b/requirements.txt index e524b26..8b13789 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile ./requirements.in -# + diff --git a/requirements_dev.in b/requirements_dev.in deleted file mode 100644 index fbd06f6..0000000 --- a/requirements_dev.in +++ /dev/null @@ -1,9 +0,0 @@ --c requirements.txt - -build -toml -pytest -black -pylint -pytest-cov -syrupy diff --git a/requirements_dev.txt b/requirements_dev.txt index 51ab1d3..315ebe2 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,15 +1,9 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile ./requirements_dev.in -# astroid==3.0.3 # via pylint black==24.1.1 - # via -r ./requirements_dev.in + # via slack-status-cli (pyproject.toml) build==1.0.3 - # via -r ./requirements_dev.in + # via slack-status-cli (pyproject.toml) click==8.1.7 # via black coverage[toml]==7.4.1 @@ -38,19 +32,19 @@ platformdirs==4.2.0 pluggy==1.4.0 # via pytest pylint==3.0.3 - # via -r ./requirements_dev.in + # via slack-status-cli (pyproject.toml) pyproject-hooks==1.0.0 # via build pytest==7.4.4 # via - # -r ./requirements_dev.in # pytest-cov + # slack-status-cli (pyproject.toml) # syrupy pytest-cov==4.1.0 - # via -r ./requirements_dev.in + # via slack-status-cli (pyproject.toml) syrupy==4.6.0 - # via -r ./requirements_dev.in + # via slack-status-cli (pyproject.toml) toml==0.10.2 - # via -r ./requirements_dev.in + # via slack-status-cli (pyproject.toml) tomlkit==0.12.3 # via pylint diff --git a/script/bootstrap b/script/bootstrap.sh similarity index 83% rename from script/bootstrap rename to script/bootstrap.sh index 9e70818..1e58cf1 100644 --- a/script/bootstrap +++ b/script/bootstrap.sh @@ -11,4 +11,4 @@ fi source ./$PROJECT.venv/bin/activate -pip-sync ./requirements_dev.txt +pip-sync ./requirements.txt ./requirements_dev.txt diff --git a/script/lock b/script/lock deleted file mode 100644 index 7e1470b..0000000 --- a/script/lock +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -pip-compile ./requirements.in -pip-compile ./requirements_dev.in diff --git a/script/lock.sh b/script/lock.sh new file mode 100644 index 0000000..ffdeda3 --- /dev/null +++ b/script/lock.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +PROD_DEP="requirements.txt" +DEV_DEP="requirements_dev.txt" + +echo "Locking production dependencies as $PROD_DEP" + +python -m piptools compile \ + -o $PROD_DEP \ + --no-header \ + pyproject.toml + +if [[ $? != 0 ]]; then + echo "Failed to lock production dependencies." + return 1 +fi + +echo "Locking production dependencies as $DEV_DEP" + +python -m piptools compile \ + -o $DEV_DEP \ + --no-header \ + --extra dev \ + --constraint $PROD_DEP \ + pyproject.toml