summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoris Roovers <joris.roovers@gmail.com>2023-04-06 14:32:00 +0200
committerGitHub <noreply@github.com>2023-04-06 14:32:00 +0200
commit4b2c1e0473f5a792718fee539fc29592bf25d53e (patch)
treea0069d8e5a2ff1542d2891ac5cc5d77d1d43ab18
parentc785125cc6d1d4b1ce1d5e4f8ffc467df2e23502 (diff)
Docs: info on testing different python versions (#484)
The docs were missing important steps on how to test gitlint against different python versions on the dev container. Also fixes the Devcontainer's postCreateCommand.sh to install hatch using pip instead of homebrew.
-rwxr-xr-x.devcontainer/postCreateCommand.sh11
-rw-r--r--docs/contributing.md14
2 files changed, 18 insertions, 7 deletions
diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh
index e2f0f76..464ea5f 100755
--- a/.devcontainer/postCreateCommand.sh
+++ b/.devcontainer/postCreateCommand.sh
@@ -1,7 +1,6 @@
#!/bin/sh -x
brew install asdf
-brew install hatch
source "$(brew --prefix asdf)/libexec/asdf.sh"
# Install latest python
@@ -10,15 +9,17 @@ asdf install python 3.11.0
asdf global python 3.11.0
# You can easily install other python versions like so:
-# asdf install python 3.6.15
# asdf install python 3.7.15
# asdf install python 3.8.15
# asdf install python 3.9.15
# asdf install python 3.10.8
# asdf install python pypy3.9-7.3.9
+# If you do this, you also need to install hatch for each python version
+# asdf global python 3.7.15
+# pip install hatch==1.6.3
+
# Setup virtualenv, install all dependencies
cd /workspaces/gitlint
-$(asdf which python) -m venv .venv
-source .venv/bin/activate
-pip install -r requirements.txt -r test-requirements.txt -r doc-requirements.txt \ No newline at end of file
+pip install hatch==1.6.3
+hatch env create \ No newline at end of file
diff --git a/docs/contributing.md b/docs/contributing.md
index d111bc6..cf4755a 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -66,9 +66,10 @@ You do not need to setup a `virtualenv`, hatch will take care of that for you.
pip install hatch
```
-### Github Devcontainer
+### Github Codespace
-We provide a devcontainer on github to make it easier to get started with gitlint development using VSCode.
+We provide a devcontainer to use with github codespaces to make it easier to get started with gitlint development
+using VSCode.
To start one, click the plus button under the *Code* dropdown on
[the gitlint repo on github](https://github.com/jorisroovers/gitlint).
@@ -88,12 +89,21 @@ source "$(brew --prefix asdf)/libexec/asdf.sh"
# Install python 3.9.15
asdf install python 3.9.15
+# Make python 3.9.15 the default python
+asdf global python 3.9.15
+
+# IMPORTANT: install hatch for this python version
+pip install hatch==1.6.3
+# You also need to prune your hatch environment first before running other commands
+hatch env prune
+
# List all available python versions
asdf list all python
# List installed python versions
asdf list python
```
+
## Running tests
```sh
# Gitlint