Skip to content

Commit 4b2c1e0

Browse files
authored
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.
1 parent c785125 commit 4b2c1e0

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

.devcontainer/postCreateCommand.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/sh -x
22

33
brew install asdf
4-
brew install hatch
54
source "$(brew --prefix asdf)/libexec/asdf.sh"
65

76
# Install latest python
@@ -10,15 +9,17 @@ asdf install python 3.11.0
109
asdf global python 3.11.0
1110

1211
# You can easily install other python versions like so:
13-
# asdf install python 3.6.15
1412
# asdf install python 3.7.15
1513
# asdf install python 3.8.15
1614
# asdf install python 3.9.15
1715
# asdf install python 3.10.8
1816
# asdf install python pypy3.9-7.3.9
1917

18+
# If you do this, you also need to install hatch for each python version
19+
# asdf global python 3.7.15
20+
# pip install hatch==1.6.3
21+
2022
# Setup virtualenv, install all dependencies
2123
cd /workspaces/gitlint
22-
$(asdf which python) -m venv .venv
23-
source .venv/bin/activate
24-
pip install -r requirements.txt -r test-requirements.txt -r doc-requirements.txt
24+
pip install hatch==1.6.3
25+
hatch env create

docs/contributing.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ You do not need to setup a `virtualenv`, hatch will take care of that for you.
6666
pip install hatch
6767
```
6868

69-
### Github Devcontainer
69+
### Github Codespace
7070

71-
We provide a devcontainer on github to make it easier to get started with gitlint development using VSCode.
71+
We provide a devcontainer to use with github codespaces to make it easier to get started with gitlint development
72+
using VSCode.
7273

7374
To start one, click the plus button under the *Code* dropdown on
7475
[the gitlint repo on github](https://github.com/jorisroovers/gitlint).
@@ -88,12 +89,21 @@ source "$(brew --prefix asdf)/libexec/asdf.sh"
8889

8990
# Install python 3.9.15
9091
asdf install python 3.9.15
92+
# Make python 3.9.15 the default python
93+
asdf global python 3.9.15
94+
95+
# IMPORTANT: install hatch for this python version
96+
pip install hatch==1.6.3
97+
# You also need to prune your hatch environment first before running other commands
98+
hatch env prune
99+
91100
# List all available python versions
92101
asdf list all python
93102
# List installed python versions
94103
asdf list python
95104
```
96105

106+
97107
## Running tests
98108
```sh
99109
# Gitlint

0 commit comments

Comments
 (0)