diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml index d99a56de1..73e114bd8 100644 --- a/.github/actions/setup-project/action.yml +++ b/.github/actions/setup-project/action.yml @@ -15,7 +15,10 @@ runs: python-version: "3.12.3" - name: Install poetry shell: bash - run: pip install poetry==1.8.5 + run: pip install poetry==2.1.3 + - name: Install poetry export plugin + shell: bash + run: poetry self add poetry-plugin-export - name: Downgrade virtualenv to compatible version shell: bash run: pip install "virtualenv<20.30" diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 3f74ff3fb..78e878060 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -139,7 +139,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-project - name: Create requirements.txt - run: poetry export --without-hashes --format=requirements.txt > requirements.txt + run: poetry export --output requirements.txt - uses: pypa/gh-action-pip-audit@v1.1.0 with: inputs: requirements.txt diff --git a/.github/workflows/daily_checks.yml b/.github/workflows/daily_checks.yml index f5835f492..16e44dd16 100644 --- a/.github/workflows/daily_checks.yml +++ b/.github/workflows/daily_checks.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-project - name: Create requirements.txt - run: poetry export --without-hashes --format=requirements.txt > requirements.txt + run: poetry export --output requirements.txt - uses: pypa/gh-action-pip-audit@v1.1.0 with: inputs: requirements.txt diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index b16607c61..7aec7adb7 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -42,7 +42,7 @@ jobs: - uses: ./.github/actions/setup-project - name: Create requirements.txt - run: poetry export --without-hashes --format=requirements.txt > requirements.txt + run: poetry export --output requirements.txt - name: Deploy to cloud.gov uses: cloud-gov/cg-cli-tools@main diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 05c7ccf26..02e65c36c 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -42,7 +42,7 @@ jobs: - uses: ./.github/actions/setup-project - name: Create requirements.txt - run: poetry export --without-hashes --format=requirements.txt > requirements.txt + run: poetry export --output requirements.txt - name: Deploy to cloud.gov uses: cloud-gov/cg-cli-tools@main diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1a95d7ba1..221f361e4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -47,7 +47,7 @@ jobs: - uses: ./.github/actions/setup-project - name: Create requirements.txt - run: poetry export --without-hashes --format=requirements.txt > requirements.txt + run: poetry export --output requirements.txt - name: Deploy to cloud.gov diff --git a/Makefile b/Makefile index b1e39e21b..6eeda3bb5 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,7 @@ NVMSH := $(shell [ -f "$(HOME)/.nvm/nvm.sh" ] && echo "$(HOME)/.nvm/nvm.sh" || e .PHONY: bootstrap bootstrap: ## Set up everything to run the app make generate-version-file - poetry lock --no-update - poetry install --sync --no-root + poetry sync --no-root poetry run playwright install --with-deps poetry run pre-commit install source $(NVMSH) --no-use && nvm install && npm install @@ -28,8 +27,7 @@ bootstrap: ## Set up everything to run the app .PHONY: bootstrap-with-git-hooks bootstrap-with-git-hooks: ## Sets everything up and accounts for pre-existing git hooks make generate-version-file - poetry lock --no-update - poetry install --sync --no-root + poetry sync --no-root poetry run playwright install --with-deps git config --global --unset-all core.hooksPath poetry run pre-commit install @@ -129,7 +127,7 @@ py-lock: ## Syncs dependencies and updates lock file without performing recursiv .PHONY: freeze-requirements freeze-requirements: ## create static requirements.txt - poetry export --without-hashes --format=requirements.txt > requirements.txt + poetry export --output requirements.txt .PHONY: pip-audit pip-audit: diff --git a/README.md b/README.md index 9313a6f88..c8a2e44c5 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,22 @@ you'll be set with an upgraded version of Python. _If you're not sure about the details of your current virtual environment, you can run `poetry env info` to get more information. If you've been using `pyenv` for everything, you can also see all available virtual environments with `pyenv virtualenvs`._ + +#### Poetry upgrades #### + +If you are doing a new project setup, then after you install poetry you need to install the export plugin + +```sh +poetry self add poetry-plugin-export +``` + +If you are upgrading from poetry 1.8.5, you need to do this: + +```sh +curl -sSL https://install.python-poetry.org | python3 - --version 2.1.3 +poetry self add poetry-export-plugin +``` + #### Updating the .env file for Login.gov To configure the application for Login.gov, you will need to update the following environment variables in the .env file: