diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 53e9ada16..c573dd416 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -8,6 +8,10 @@ on: branches: - main +env: + working-directory: bindings/python + PIP_DISABLE_PIP_VERSION_CHECK: "true" + jobs: test: strategy: @@ -23,9 +27,6 @@ jobs: - "3.11" - "3.12" runs-on: ${{ matrix.os }} - env: - working-directory: ./bindings/python - PIP_DISABLE_PIP_VERSION_CHECK: "true" defaults: run: @@ -77,8 +78,30 @@ jobs: - name: Run Ruff format check run: ruff format --diff - - name: Install Limbo - run: pip install -e . + check-requirements: + runs-on: ubuntu-latest - - name: Run Pytest - run: pytest tests + defaults: + run: + working-directory: ${{ env.working-directory }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install pip-tools + run: pip install pip-tools + + - name: Check requirements files + run: | + mkdir .tmp + pip-compile --quiet --output-file .tmp/requirements.txt + pip-compile --quiet --extra=dev --output-file .tmp/requirements-dev.txt + diff -u requirements.txt .tmp/requirements.txt || (echo "requirements.txt doesn't match pyproject.toml" && exit 1) + diff -u requirements-dev.txt .tmp/requirements-dev.txt || (echo "requirements-dev.txt doesn't match pyproject.toml" && exit 1) + echo "Requirements files match pyproject.toml" diff --git a/.gitignore b/.gitignore index 9e065fc75..2e0356080 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ env .env .venv dist/ +.tmp/ # OS .DS_Store diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml index 42743c84b..959300a1b 100644 --- a/bindings/python/pyproject.toml +++ b/bindings/python/pyproject.toml @@ -48,6 +48,11 @@ bindings = 'pyo3' module-name = "limbo._limbo" features = ["pyo3/extension-module"] +[tool.pip-tools] +strip-extras = true +header = false +upgrade = false + [tool.ruff] line-length = 120 diff --git a/bindings/python/requirements-dev.txt b/bindings/python/requirements-dev.txt index f3fcc6bed..d713f3e5d 100644 --- a/bindings/python/requirements-dev.txt +++ b/bindings/python/requirements-dev.txt @@ -1,9 +1,3 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --extra=dev --output-file=requirements-dev.txt --strip-extras pyproject.toml -# black==24.4.2 # via limbo (pyproject.toml) click==8.1.7 diff --git a/bindings/python/requirements.txt b/bindings/python/requirements.txt index 297f1f7cd..d803b3772 100644 --- a/bindings/python/requirements.txt +++ b/bindings/python/requirements.txt @@ -1,8 +1,2 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --strip-extras pyproject.toml -# typing-extensions==4.12.2 # via limbo (pyproject.toml)