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

chore: add VS Code dev container #2132

Merged
merged 2 commits into from
Nov 27, 2022
Merged

Conversation

mihaitodor
Copy link
Contributor

Summary of Changes

This adds the required config for VS Code Dev Container support. With this change, opening the repo in VS Code will prompt you to reload the editor and, assuming you have Docker up and running, it will pull the required Docker image and start it. Expect it to download a 1.4GB image. Once the container is running, it will install a bunch of dependencies, including tox. It will show you the log as it progresses, but, at the end of the process, VS Code will run in this container in headless mode and you can open a separate terminal in which you can run the tox command which should complete successfully.

I haven't spotted any specific section related to the code editor in the Readme / Contributing docs, so not sure if you'd like to have a paragraph about this feature, or at least mention somewhere that people will want to use VS Code if they wish to leverage this Dev Container setup for their work / tests.

Related Issues

Fixes #1979.

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

  • Applied changes to both WSGI and ASGI code paths and interfaces (where applicable).
  • Added tests for changed code.
  • Prefixed code comments with GitHub nick and an appropriate prefix.
  • Coding style is consistent with the rest of the framework.
  • Updated documentation for changed code.
    • Added docstrings for any new classes, functions, or modules.
    • Updated docstrings for any modifications to existing code.
    • Updated both WSGI and ASGI docs (where applicable).
    • Added references to new classes, functions, or modules to the relevant RST file under docs/.
    • Updated all relevant supporting documentation files under docs/.
    • A copyright notice is included at the top of any new modules (using your own name or the name of your organization).
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
  • Changes (and possible deprecations) have towncrier news fragments under docs/_newsfragments/, with the file name format {issue_number}.{fragment_type}.rst. (Run towncrier --draft to ensure it renders correctly.)

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Merging #2132 (c9933a3) into master (e00f5cd) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master     #2132   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           55        55           
  Lines         5553      5553           
  Branches       880       880           
=========================================
  Hits          5553      5553           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@vytas7 vytas7 changed the title Add VS Code Dev Container chore: add VS Code dev container Nov 23, 2022
@CaselIT
Copy link
Member

CaselIT commented Nov 23, 2022

I've tried using podman on wsl fedora and everything seems to work but I've had to uncomment "remoteUser": "root" or is was failing to copy some stuff when initializing the container.

This is probably a potman thing only since I think it will not run containers as root contrary to docker.

I think we could keep as is. @vytas7 thoughts?

Copy link
Member

@CaselIT CaselIT left a comment

Choose a reason for hiding this comment

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

As suggested in the issue a couple of lines could be added in the contributing file

looking ok otherwise

@mihaitodor
Copy link
Contributor Author

@CaselIT Thanks for testing! I added some documentation as requested. If you think it's too detailed / wordy, I'm happy to adjust it.

@vytas7
Copy link
Member

vytas7 commented Nov 27, 2022

(It seems that flake8-import-order has now been updated with support for the newest flake8, rerunning the CI.)

Copy link
Member

@vytas7 vytas7 left a comment

Choose a reason for hiding this comment

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

As I understand, this needs to be enabled manually by the developer, so it shouldn't cause any problems for other VS Code users. So if it can potentially lower the barrier to contribution, why not? 🎉

@vytas7 vytas7 merged commit 5b9e1ff into falconry:master Nov 27, 2022
@mihaitodor
Copy link
Contributor Author

Yeah, they'll be asked when they open the project in VS Code if they want to reopen it in a Dev Container, but they can just click no.

@vytas7
Copy link
Member

vytas7 commented Nov 27, 2022

Aha, OK, I didn't know that VSCode would ask that question automatically. But let's give it a try, we can always disable this if we get more negative than positive feedback.

@CaselIT
Copy link
Member

CaselIT commented Nov 27, 2022

It's just a notification, you can just ignore it too, so it should be fine

@vytas7
Copy link
Member

vytas7 commented Nov 28, 2022

I see; I've just tested it myself for the heck of it, and it should be fine 💯 Let's see if anyone complains 😈

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.

Would you consider maintaining a devcontainer for VS Code?
3 participants