-
-
Notifications
You must be signed in to change notification settings - Fork 31
doc: Add directions for using dev containers #237
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
Merged
Ckk3
merged 7 commits into
strawberry-graphql:main
from
fruitymedley:juniper/#192-dev-container
Mar 20, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9fed7ce
doc: Add directions for using dev containers
fruitymedley 0d74740
doc: add multiple setup options
fruitymedley 4aa70e1
doc: refer readme to docs
fruitymedley fd4a0de
doc: Fix git links
fruitymedley 944f2e6
doc: clarify variable
fruitymedley f84d0d1
doc: move obsolete tutorial to todo
fruitymedley 29b02ec
doc: Fix git links again
fruitymedley 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 hidden or 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 |
---|---|---|
|
@@ -102,64 +102,93 @@ and use Python's built-in web server for a preview in your web browser | |
|
||
python3 -m http.server --directory 'docs/_build/html' | ||
|
||
Project Setup | ||
============= | ||
|
||
Code Contributions | ||
================== | ||
Clone the repository | ||
-------------------- | ||
|
||
.. todo:: Please include a reference or explanation about the internals of the project. | ||
#. Create an user account on |the repository service| if you do not already have one. | ||
#. Fork the project repository_: click on the *Fork* button near the top of the | ||
page. This creates a copy of the code under your account on |the repository service|. | ||
#. Clone this copy to your local disk:: | ||
|
||
An architecture description, design principles or at least a summary of the | ||
main concepts will make it easy for potential contributors to get started | ||
quickly. | ||
git clone [email protected]:YOUR_USERNAME_HERE/strawberry-sqlalchemy-mapper.git | ||
cd strawberry-sqlalchemy-mapper | ||
|
||
Submit an issue | ||
--------------- | ||
Install dependencies and plugins | ||
-------------------------------- | ||
|
||
Before you work on any non-trivial code contribution it's best to first create | ||
a report in the `issue tracker`_ to start a discussion on the subject. | ||
This often provides additional considerations and avoids unnecessary work. | ||
.. todo:: Rewrite the following snippets to use the poetry environment rather than setuptools | ||
|
||
Create an environment | ||
--------------------- | ||
There are two ways to set up the environment for local development: | ||
|
||
Before you start coding, we recommend creating an isolated `virtual | ||
environment`_ to avoid any problems with your installed Python packages. | ||
This can easily be done via either |virtualenv|_:: | ||
#. Manual environment setup | ||
|
||
virtualenv <PATH TO VENV> | ||
source <PATH TO VENV>/bin/activate | ||
#. Dev Container setup | ||
|
||
or Miniconda_:: | ||
Method 1: Manual environment setup | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
conda create -n strawberry-sqlalchemy-mapper python=3 six virtualenv pytest pytest-cov | ||
conda activate strawberry-sqlalchemy-mapper | ||
#. Before you start coding, we recommend creating an isolated `virtual | ||
environment`_ to avoid any problems with your installed Python packages. | ||
This can easily be done via either |virtualenv|_:: | ||
|
||
Clone the repository | ||
-------------------- | ||
virtualenv <PATH TO VENV> | ||
source <PATH TO VENV>/bin/activate | ||
|
||
#. Create an user account on |the repository service| if you do not already have one. | ||
#. Fork the project repository_: click on the *Fork* button near the top of the | ||
page. This creates a copy of the code under your account on |the repository service|. | ||
#. Clone this copy to your local disk:: | ||
or Miniconda_:: | ||
|
||
git clone [email protected]:YourLogin/strawberry-sqlalchemy-mapper.git | ||
cd strawberry-sqlalchemy-mapper | ||
conda create -n strawberry-sqlalchemy-mapper python=3 six virtualenv pytest pytest-cov | ||
conda activate strawberry-sqlalchemy-mapper | ||
|
||
#. You should run:: | ||
Ckk3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#. You should run:: | ||
|
||
pip install -U pip setuptools -e . | ||
pip install -U pip setuptools -e . | ||
|
||
to be able to import the package under development in the Python REPL. | ||
Ckk3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
to be able to import the package under development in the Python REPL. | ||
|
||
.. todo:: if you are not using pre-commit, please remove the following item: | ||
.. todo:: if you are not using pre-commit, please remove the following item: | ||
|
||
#. Install |pre-commit|_:: | ||
|
||
pip install pre-commit | ||
pre-commit install | ||
|
||
``strawberry-sqlalchemy-mapper`` comes with a lot of hooks configured to automatically help the | ||
developer to check the code being written. | ||
|
||
|
||
Method 2: Dev Container setup | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
#. Install `Dev Containers`_. | ||
|
||
#. Install |pre-commit|_:: | ||
#. Press ``Ctrl+Shift+P`` to open the command tab and enter ``Dev Containers: Open Folder in Container...``. | ||
Ckk3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
pip install pre-commit | ||
pre-commit install | ||
#. Select the root directory of this repository. | ||
Dev Containers will now install the environment dependencies as well as |pre-commit|_ | ||
|
||
#. When installation is complete, press ``Ctrl+Shift+P`` to open the command tab and enter ``Python Select Interpreter`` | ||
|
||
#. Select the environment labeled 'poetry'. | ||
|
||
|
||
Code Contributions | ||
================== | ||
|
||
``strawberry-sqlalchemy-mapper`` comes with a lot of hooks configured to automatically help the | ||
developer to check the code being written. | ||
.. todo:: Please include a reference or explanation about the internals of the project. | ||
|
||
An architecture description, design principles or at least a summary of the | ||
main concepts will make it easy for potential contributors to get started | ||
quickly. | ||
|
||
Submit an issue | ||
--------------- | ||
|
||
Before you work on any non-trivial code contribution it's best to first create | ||
a report in the `issue tracker`_ to start a discussion on the subject. | ||
fruitymedley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This often provides additional considerations and avoids unnecessary work. | ||
|
||
Implement your changes | ||
---------------------- | ||
|
@@ -314,8 +343,8 @@ on PyPI_, the following steps can be used to release a new version for | |
.. |the repository service| replace:: GitHub | ||
.. |contribute button| replace:: "Create pull request" | ||
|
||
.. _repository: https://github.com/<USERNAME>/strawberry-sqlalchemy-mapper | ||
.. _issue tracker: https://github.com/<USERNAME>/strawberry-sqlalchemy-mapper/issues | ||
.. _repository: https://github.com/strawberry-graphql/strawberry-sqlalchemy | ||
.. _issue tracker: https://github.com/strawberry-graphql/strawberry-sqlalchemy/issues | ||
.. <-- end --> | ||
|
||
|
||
|
@@ -329,6 +358,7 @@ on PyPI_, the following steps can be used to release a new version for | |
.. _contribution-guide.org: https://www.contribution-guide.org/ | ||
.. _creating a PR: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request | ||
.. _descriptive commit message: https://chris.beams.io/posts/git-commit | ||
.. _Dev Containers: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers | ||
.. _docstrings: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html | ||
.. _first-contributions tutorial: https://github.com/firstcontributions/first-contributions | ||
.. _flake8: https://flake8.pycqa.org/en/stable/ | ||
|
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.