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

doc: Add directions for using dev containers #237

Merged
merged 7 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 58 additions & 30 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,48 +102,43 @@ 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]:YourLogin/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.
There are two ways to set up the environment for local development:

Create an environment
---------------------
#. Manual environment setup

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|_::
#. Dev Container setup

virtualenv <PATH TO VENV>
source <PATH TO VENV>/bin/activate
Method 1: Manual environment setup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

or Miniconda_::
#. 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|_::

conda create -n strawberry-sqlalchemy-mapper python=3 six virtualenv pytest pytest-cov
conda activate strawberry-sqlalchemy-mapper
virtualenv <PATH TO VENV>
source <PATH TO VENV>/bin/activate

Clone the repository
--------------------
or Miniconda_::

#. 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::

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::

Expand All @@ -161,6 +156,38 @@ Clone the repository
``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`_.

#. Press ``Ctrl+Shift+P`` to open the command tab and enter ``Dev Containers: Open Folder in Container...``.

#. 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
==================

.. 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.
This often provides additional considerations and avoids unnecessary work.

Implement your changes
----------------------

Expand Down Expand Up @@ -329,6 +356,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/
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ If you have a suggestion that would make this better, please fork the repo and c
4. Push to the Branch (git push origin feature)
5. Open a Pull Request

For more details on how to contribute, as well as how to setup the project on your local machine, please refer to [the docs](CONTRIBUTING.rst)


### Prerequisites

Expand Down
Loading