-
Notifications
You must be signed in to change notification settings - Fork 298
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 devcontainer #1085
Merged
Merged
✨ Add devcontainer #1085
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b13a08a
✨ Add devcontainer
julien-blanchon ed3fef4
🐛 Add postCreateCommand.sh
julien-blanchon 4e1127f
Downgrade to Python 3.10
julien-blanchon f8be16c
Add gdal
julien-blanchon ebffec2
Separate CPU/GPU devcontainer.json
julien-blanchon d726458
Add cpu as default
julien-blanchon e01eec1
Rename default
julien-blanchon 7793f9f
In order to enable vscode black auto format, color must be disable !
julien-blanchon 7fa549c
Remove default root devcontainer
julien-blanchon aa1f886
Format and clean
julien-blanchon 4017d2b
Switch to .[dataset ...]
julien-blanchon 81ba1d0
Add postStartCommand with pip install -e .
julien-blanchon 4147e06
Fix black
julien-blanchon 966b2fd
Update
julien-blanchon 098bf84
Mise à jour des commandes postCreateCommand et postStartCommand dans …
julien-blanchon 50e1378
🔥 Add devcontainer
julien-blanchon f67c5a0
Merge branch 'main' into devcontainer
julien-blanchon e188659
Update Python version and postStartCommand in devcontainer.json
julien-blanchon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
{ | ||
"name": "Torchgeo DevContainer", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/python:3.12", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/git:1": { "version": "os-provided" } | ||
}, | ||
|
||
// "postCreateCommand": "", | ||
"postStartCommand": "pip install -e .[all]", | ||
|
||
// Enable GPU support | ||
"hostRequirements": { | ||
"gpu": "optional" | ||
}, | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.isort", | ||
"ms-python.black-formatter", | ||
"ms-python.vscode-pylance", | ||
"ms-python.pylint", | ||
"ms-python.flake8", | ||
"ms-python.mypy-type-checker", | ||
"GitHub.codespaces", | ||
"ms-toolsai.jupyter" | ||
], | ||
"settings": { | ||
"telemetry.telemetryLevel": "off", | ||
"python.languageServer": "Pylance", | ||
"python.defaultInterpreterPath": "/usr/local/bin/python", | ||
"python.formatting.blackPath": "/usr/local/py-utils/bin/black", | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.pytestPath": "/usr/local/py-utils/bin/pytest", | ||
"python.editor.formatOnSave": true, | ||
"python.editor.formatOnSaveMode": "file", | ||
"python.editor.formatOnPaste": false, | ||
"python.editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
}, | ||
"python.diffEditor.wordWrap": "off", | ||
"isort.args": ["--profile", "black"], | ||
"isort.path": ["/home/vscode/.local/bin/isort"] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these? Not sure if I want to enforce any style constraints that aren't already enforced in CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's extension, I would keep them espectially pylance. This give many IDE feedback to the user even before the CI. For example the current settings will display pylint error on the IDE side before any CI. Black will also auto format the code on file save with the same specification as the CI. This may put less work on the CI side and enforce best practice directly in the IDE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I definitely want to keep black/mypy/isort/pydocstyle/flake8 because we also enforce that in CI. I'm specifically commenting on things like pylance and pylint which we don't use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove pylint. I would keep pylance anyway because it's just visual, it doesn't enforce anything, but feel free to remove it if you'r sure you don't need it
Btw for torchgeo in general you can have a look to ruff that bundle everything in a single package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1908 (comment) for my thoughts on ruff. Not strongly opposed in principle, but let's discuss that in a separate issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does pylance flag anything that the other tools don't flag?