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

Add GitHub Codespaces integration #199

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

alexanderilyin
Copy link

@alexanderilyin alexanderilyin commented Nov 8, 2024

Changed

  • .vscode/ folder is replaced with .devcontainer/.

Added

  • deep-space-cartel/apt takes care of the host dependencies.
  • pre-commit takes care of newlines & etc.
  • Poetry configuration to improve development experience.

TODO

  • Move whitespace changes to separate commit.
  • Deal with changes in NOTES.md and README.md.
  • Deal with permission changes: 100644 → 100755.
  • Remove ocp_vscode_demo.py.

TIL

Current version of cadquery-ocp depends on glibc 2.35 and as result it does not install on Debian11/Bullseye but everything is fine on Debian12/Bookworm. It was main problem with partcad-cli & Poetry: python-poetry/poetry#9837

@alexanderilyin alexanderilyin marked this pull request as draft November 8, 2024 09:17
// TODO: as well as those: libcairo2-dev pkg-config python3-dev // https://pycairo.readthedocs.io/en/latest/getting_started.html
// ffmpeg libsm6 libxext6 to fix ImportError: libGL.so.1: cannot open shared object file: No such file or directory
// openscad: is needed for "pc inspect :test"
"packages": "shellcheck bash-completion cmake libcairo2-dev pkg-config python3-dev ffmpeg libsm6 libxext6 openscad" // shfmt
Copy link
Author

Choose a reason for hiding this comment

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

This is "editable" mode. There are couple options for long term:

  • Switch to Dockerfile based Dev Containers and add RUN apt-get ... there.
    • This is a bit more flexible but provisioning slow and not reproducible.
  • Build new "base" image for partcad development env.
    • This is a bit less flexible but provisioning fast and reproducible.

Comment on lines +17 to +20
"ghcr.io/deep-space-cartel/devcontainers-features/pip:1": {
"packages": "pre-commit poetry",
"location": "/opt/pip"
},
Copy link
Author

Choose a reason for hiding this comment

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

Same here, probably should go to the new "base" image.

Comment on lines +21 to +23
"ghcr.io/deep-space-cartel/devcontainers-features/starship:latest": {
"version": "latest"
}
Copy link
Author

Choose a reason for hiding this comment

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

I started using https://starship.rs/ for my terminal and kinda happy with it, but I saw @openvmp is using something else like tmux or zsh. This is very opinionated topic what's the best. Here is the example of my prompt:

image

Here is another example which in addition to git state shows:

  • Current package version.
  • Current Python version.
  • Current Python environment.

image

Comment on lines +25 to +27
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/opt/pip/bin"
},
Copy link
Author

Choose a reason for hiding this comment

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

This is to add pre-commit and poetry to $PATH.

Comment on lines +36 to +48
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
}
]
},
Copy link
Author

Choose a reason for hiding this comment

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

It would be nice to add debugger configuration for poetry since that glibc dependency was not obvious, as well as configuration to run pc with debugger.

Copy link
Author

Choose a reason for hiding this comment

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

This should be removed.

Copy link
Author

Choose a reason for hiding this comment

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

This is Poetry package requirement, probably should write here something.

Comment on lines +1 to +3
[virtualenvs]
create = true
in-project = true
Copy link
Author

Choose a reason for hiding this comment

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

This allows to store .venv on the host fs which makes starting of Dev Container faster.

requests = "^2.32.3"
aiofiles = "^24.1.0"
aiohttp = "^3.10.10"
google-generativeai = "^0.8.3"
Copy link
Author

Choose a reason for hiding this comment

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

google-generativeai, openai & etc might become "extras":

license = "Apache"
readme = "README.md"

[tool.poetry.dependencies]
Copy link
Author

Choose a reason for hiding this comment

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

Need to define dev dependencies and put pytest there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant