Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Migrate package manager to uv#1553

Open
FallenDeity wants to merge 4 commits into
PokeAPI:master from
FallenDeity:feat/migrate-to-uv
Open

feat: Migrate package manager to uv #1553
FallenDeity wants to merge 4 commits into
PokeAPI:master from
FallenDeity:feat/migrate-to-uv

Conversation

@FallenDeity

@FallenDeity FallenDeity commented Jun 10, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Change description

First set of pr for migrating and adopting modern python tooling ecosystem, this pr attempts to migrate from pip to uv for package management as discussed in #1391 & #1521 it breaks down the changes @phalt initially made to smaller more iterative parts

cc: @phalt @Naramsim

AI coding assistance disclosure

Used a bit for reviewing the changes and coverage if I missed any transitive command update

Contributor check list

  • I have written a description of the contribution and explained its motivation.
  • I have written tests for my code changes (if applicable).
  • I have read and understood the AI Assisted Contribution guidelines.
  • I will own this change in production, and I am prepared to fix any bugs caused by my code change.

@FallenDeity FallenDeity marked this pull request as ready for review June 10, 2026 19:19
Comment thread .circleci/config.yml
jobs:
test:
docker:
- image: cimg/python:3.13.7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a matrix here and test LTS and the newest python version?

@FallenDeity FallenDeity Jun 11, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a matrix in circle ci for make test and one in database.yml sqlite job for make build-db which are python version dependent moved the formatting and openapi spec generation to a separate step in circleci since they are not python version dependent

Comment thread .python-version
@@ -0,0 +1 @@
3.14

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this file? I'd like to support multiple Python versions.

@FallenDeity FallenDeity Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well there are a few benefits to having the interpreter version pinned, the pipeline uv sets up automatically + make install/setup (uv sync) auto installs the suitable python version

I think having a pinned python version for the project is fine since uv handles that anyways and to run it with diff versions locally the developer can either use the --python flag with uv or modify the version pin temporarily https://docs.astral.sh/uv/concepts/python-versions/#requesting-a-version

instead in the pipeline we can have the matrix which runs the project against diff version and the dev can later modify it locally we can make a note in the readme

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding a default python version is probably a good idea, but I agree that we should test older versions. I think adding them to the testing matrix is a good approach.

Comment thread docker-compose.yml
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://${POSTGRES_USER:-ash}:${POSTGRES_PASSWORD:-pokemon}@db:5432/${POSTGRES_DB:-pokeapi}
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
HASURA_GRAPHQL_ENABLE_CONSOLE: "false"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why false?

@FallenDeity FallenDeity Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved all the dev settings to the -dev compose file and left this as barebones base compose file, the graphql console is not really a recommended setting to be enabled to be in prod/ is a local/dev based setting so figured overriding it in the dev compose file is a more suitable location for it

is there any particular reason for us to have it globally set to true I am not that familiar with graphql but shouldnt the console be enabled in a much more limited manner or does it not matter in our case?

Comment on lines +60 to +72
image: postgres:16
env:
POSTGRES_USER: pokeapi
POSTGRES_PASSWORD: pokeapi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not as familiar with the docker and pg_dump commands in this YAML, but this seems separate from the UV shift. I'm not opposed, but could you describe what the changes here would do?

@@ -1,35 +1,37 @@
FROM python:3.13.7-alpine AS builder
FROM python:3.14-alpine as builder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be concerned with the automated warnings from Github on this line?

Comment thread .python-version
@@ -0,0 +1 @@
3.14

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding a default python version is probably a good idea, but I agree that we should test older versions. I think adding them to the testing matrix is a good approach.

Comment thread Makefile
Comment on lines +41 to 42
test: check-uv # Run tests
uv run manage.py test ${local_config}

clean: # Remove any pyc files

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Less a question directed at you, but is there a reason we have two targets that do the same thing (setup and migrate)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Naramsim Naramsim Naramsim left review comments

+1 more reviewer

@jemarq04 jemarq04 jemarq04 left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /