Merge pull request #2615 from GSA/poetry

upgrade poetry to 2.1.3
This commit is contained in:
ccostino
2025-05-30 11:50:27 -04:00
committed by GitHub
8 changed files with 28 additions and 11 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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: