Merge branch 'sh' · gitpython-developers/GitPython@4345faa (original) (raw)
`@@ -76,17 +76,20 @@ To clone the [the GitHub repository](https://github.com/gitpython-developers/Git
`
76
76
```` ```bash
`77`
`77`
`git clone https://github.com/gitpython-developers/GitPython
`
`78`
`78`
`cd GitPython
`
`79`
``
`-
git fetch --tags
`
`80`
`79`
`./init-tests-after-clone.sh
`
`81`
`80`
```` ```
82
81
``
``
82
`` +
On Windows, ./init-tests-after-clone.sh
can be run in a Git Bash shell.
``
``
83
+
83
84
`` If you are cloning your own fork, then replace the above git clone
command with one that gives the URL of your fork. Or use this gh
command (assuming you have gh
and your fork is called GitPython
):
``
84
85
``
85
86
```` ```bash
`86`
`87`
`gh repo clone GitPython
`
`87`
`88`
```` ```
88
89
``
89
``
`-
Having cloned the repo, create and activate your virtual environment. Then make an editable install:
`
``
90
`+
Having cloned the repo, create and activate your virtual environment.
`
``
91
+
``
92
`+
Then make an editable install:
`
90
93
``
91
94
```` ```bash
`92`
`95`
`pip install -e ".[test]"
`
`@@ -114,9 +117,9 @@ See [Issue #525](https://github.com/gitpython-developers/GitPython/issues/525).
`
`114`
`117`
``
`115`
`118`
`### RUNNING TESTS
`
`116`
`119`
``
`117`
``
`-
_Important_: Right after cloning this repository, please be sure to have
`
`118`
``
`` -
executed `git fetch --tags` followed by the `./init-tests-after-clone.sh`
``
`119`
``
`-
script in the repository root. Otherwise you will encounter test failures.
`
``
`120`
`+
_Important_: Right after cloning this repository, please be sure to have executed
`
``
`121`
`` +
the `./init-tests-after-clone.sh` script in the repository root. Otherwise
``
``
`122`
`+
you will encounter test failures.
`
`120`
`123`
``
`121`
`124`
`` On _Windows_, make sure you have `git-daemon` in your PATH. For MINGW-git, the `git-daemon.exe`
``
`122`
`125`
`` exists in `Git\mingw64\libexec\git-core\`.
``
`@@ -143,30 +146,41 @@ To test, run:
`
`143`
`146`
`pytest
`
`144`
`147`
```` ```
145
148
``
146
``
`-
To lint, run:
`
``
149
`+
To lint, and apply automatic code formatting, run:
`
147
150
``
148
151
```` ```bash
`149`
`152`
`pre-commit run --all-files
`
`150`
`153`
```` ```
151
154
``
``
155
`` +
- Linting without modifying code can be done with:
make lint
``
``
156
`` +
- Auto-formatting without other lint checks can be done with:
black .
``
``
157
+
152
158
`To typecheck, run:
`
153
159
``
154
160
```` ```bash
`155`
`161`
`mypy -p git
`
`156`
`162`
```` ```
157
163
``
158
``
`-
For automatic code formatting, run:
`
``
164
`+
CI (and tox)
`
159
165
``
160
``
```bash
161
``
`-
black .
`
162
``
```
``
166
`+
The same linting, and running tests on all the different supported Python versions, will be performed:
`
``
167
+
``
168
`+
- Upon submitting a pull request.
`
``
169
`+
- On each push, if you have a fork with GitHub Actions enabled.
`
``
170
`` +
- Locally, if you run
tox
(this skips any Python versions you don't have installed).
``
``
171
+
``
172
`+
Configuration files
`
``
173
+
``
174
`+
Specific tools:
`
163
175
``
164
``
`` -
Configuration for flake8 is in the ./.flake8
file.
``
``
176
`` +
- Configurations for
mypy
,pytest
,coverage.py
, andblack
are in./pyproject.toml
.
``
``
177
`` +
- Configuration for
flake8
is in the./.flake8
file.
``
165
178
``
166
``
`` -
Configurations for mypy
, pytest
, coverage.py
, and black
are in ./pyproject.toml
.
``
``
179
`+
Orchestration tools:
`
167
180
``
168
``
`-
The same linting and testing will also be performed against different supported python versions
`
169
``
`-
upon submitting a pull request (or on each push if you have a fork with a "main" branch and actions enabled).
`
``
181
`` +
- Configuration for
pre-commit
is in the./.pre-commit-config.yaml
file.
``
``
182
`` +
- Configuration for
tox
is in./tox.ini
.
``
``
183
`` +
- Configuration for GitHub Actions (CI) is in files inside
./.github/workflows/
.
``
170
184
``
171
185
`### Contributions
`
172
186
``