Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve devops - #64

Closed
2 tasks done
jacksonjacobs1 opened this issue Jan 22, 2025 · 5 comments · Fixed by #68
Closed
2 tasks done

Improve devops - #64

jacksonjacobs1 opened this issue Jan 22, 2025 · 5 comments · Fixed by #68
Labels
enhancement New feature or request v2.0 Pertains to the v2.0 branch

Comments

@jacksonjacobs1
Copy link
Collaborator

jacksonjacobs1 commented Jan 22, 2025

Description

Re-running the dev container currently requires an image rebuild when code changes. Additionally, pip is slow.

Implementation notes

  1. Extract dependencies from pyproject.toml into requirements.txt file. The txt file will be referenced by the toml file.
    https://stackoverflow.com/questions/73600082/how-to-reference-a-requirements-txt-in-the-pyproject-toml-of-a-setuptools-projec
  2. Only copy requirements.txt and node dependencies into the container.
  3. Remove pip install -e quickannotator from the Dockerfile and instead tell devcontainers to run this after building the image.
  4. Add RUN commands to dockerfile to install and use UV instead of pip and virtualenv.

Acceptance criteria

  • Code editing no longer invalidates the cached docker image layer
  • uv is used for all python package management
@jacksonjacobs1 jacksonjacobs1 added enhancement New feature or request v2.0 Pertains to the v2.0 branch labels Jan 22, 2025
@choosehappy
Copy link
Owner

consider using poetry or uv directly instead of "extracting" stuff from the toml, both appear to support pyproject.tomls directly: https://docs.astral.sh/uv/configuration/files/

@jacksonjacobs1
Copy link
Collaborator Author

Looks like pip does not yet support installing dependencies without installing the main package:
pypa/pip#11440

So if we go the route of using uv to read from the pyproject.toml, we would be tightly coupling quickannotator to uv (note that uv expects a [tool.uv] section in the toml file).

I think we should avoid this tight coupling.

@choosehappy
Copy link
Owner

wa wa wa... what about something like pip-compile?

https://pip-tools.readthedocs.io/en/latest/cli/pip-compile/

@jacksonjacobs1
Copy link
Collaborator Author

That'd work! does it come with python? Looks like it doesn't on my end.

@choosehappy
Copy link
Owner

its not a default package, would need to be installed :-\

pip install pip-tools

@jacksonjacobs1 jacksonjacobs1 linked a pull request Feb 12, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2.0 Pertains to the v2.0 branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants