You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-23
Original file line number
Diff line number
Diff line change
@@ -49,30 +49,51 @@ The installer takes care of installing them for you.
49
49
50
50
### INSTALL
51
51
52
-
If you have downloaded the source code:
52
+
GitPython and its required package dependencies can be installed in any of the following ways, all of which should typically be done in a [virtual environment](https://docs.python.org/3/tutorial/venv.html).
53
53
54
-
```bash
55
-
python setup.py install
56
-
```
54
+
#### From PyPI
57
55
58
-
or if you want to obtain a copy from the Pypi repository:
56
+
To obtain and install a copy [from PyPI](https://pypi.org/project/GitPython/), run:
59
57
60
58
```bash
61
59
pip install GitPython
62
60
```
63
61
64
-
Both commands will install the required package dependencies.
62
+
(A distribution package can also be downloaded for manual installation at [the PyPI page](https://pypi.org/project/GitPython/).)
63
+
64
+
#### From downloaded source code
65
+
66
+
If you have downloaded the source code, run this from inside the unpacked `GitPython` directory:
67
+
68
+
```bash
69
+
pip install .
70
+
```
65
71
66
-
A distribution package can be obtained for manual installation at: <http://pypi.python.org/pypi/GitPython>.
72
+
#### By cloning the source code repository
67
73
68
-
If you like to clone from source, you can do it like so:
74
+
To clone the [the GitHub repository](https://github.com/gitpython-developers/GitPython)from source to work on the code, you can do it like so:
If you are cloning [your own fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks), then replace the above `git clone` command with one that gives the URL of your fork. Or use this [`gh`](https://cli.github.com/) command (assuming you have `gh` and your fork is called `GitPython`):
84
+
85
+
```bash
86
+
gh repo clone GitPython
87
+
```
88
+
89
+
Having cloned the repo, create and activate your [virtual environment](https://docs.python.org/3/tutorial/venv.html). Then make an [editable install](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs):
90
+
91
+
```bash
92
+
pip install -e ".[test]"
93
+
```
94
+
95
+
In the less common case that you do not want to install test dependencies, `pip install -e .` can be used instead.
96
+
76
97
### Limitations
77
98
78
99
#### Leakage of System Resources
@@ -101,20 +122,49 @@ On _Windows_, make sure you have `git-daemon` in your PATH. For MINGW-git, the `
101
122
exists in `Git\mingw64\libexec\git-core\`; CYGWIN has no daemon, but should get along fine
102
123
with MINGW's.
103
124
104
-
Ensure testing libraries are installed.
105
-
In the root directory, run: `pip install -r test-requirements.txt`
125
+
#### Install test dependencies
106
126
107
-
To lint, run: `pre-commit run --all-files`
127
+
Ensure testing libraries are installed. This is taken care of already if you installed with:
108
128
109
-
To typecheck, run: `mypy -p git`
129
+
```bash
130
+
pip install -e ".[test]"
131
+
```
110
132
111
-
To test, run:`pytest`
133
+
Otherwise, you can run:
112
134
113
-
For automatic code formatting run: `black git`
135
+
```bash
136
+
pip install -r test-requirements.txt
137
+
```
138
+
139
+
#### Test commands
140
+
141
+
To test, run:
142
+
143
+
```bash
144
+
pytest
145
+
```
146
+
147
+
To lint, run:
148
+
149
+
```bash
150
+
pre-commit run --all-files
151
+
```
152
+
153
+
To typecheck, run:
154
+
155
+
```bash
156
+
mypy -p git
157
+
```
158
+
159
+
For automatic code formatting, run:
160
+
161
+
```bash
162
+
black git
163
+
```
114
164
115
-
Configuration for flake8 is in the ./.flake8 file.
165
+
Configuration for flake8 is in the `./.flake8` file.
116
166
117
-
Configurations for mypy, pytest and coverage.pyare in ./pyproject.toml.
167
+
Configurations for `mypy`, `pytest`, `coverage.py`, and `black`are in `./pyproject.toml`.
118
168
119
169
The same linting and testing will also be performed against different supported python versions
120
170
upon submitting a pull request (or on each push if you have a fork with a "main" branch and actions enabled).
@@ -138,13 +188,15 @@ Please have a look at the [contributions file][contributing].
138
188
139
189
### How to make a new release
140
190
141
-
- Update/verify the **version** in the `VERSION` file
142
-
- Update/verify that the `doc/source/changes.rst` changelog file was updated
143
-
- Commit everything
144
-
- Run `git tag -s <version>` to tag the version in Git
145
-
- Run `make release`
191
+
- Update/verify the **version** in the `VERSION` file.
192
+
- Update/verify that the `doc/source/changes.rst` changelog file was updated.
193
+
- Commit everything.
194
+
- Run `git tag -s <version>` to tag the version in Git.
195
+
-_Optionally_ create and activate a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) using `venv` or `virtualenv`.\
196
+
(When run in a virtual environment, the next step will automatically take care of installing `build` and `twine` in it.)
197
+
- Run `make release`.
146
198
- Close the milestone mentioned in the _changelog_ and create a new one. _Do not reuse milestones by renaming them_.
147
-
-Got to [GitHub Releases](https://github.com/gitpython-developers/GitPython/releases) and publish a new one with the recently pushed tag. Generate the changelog.
199
+
-Go to [GitHub Releases](https://github.com/gitpython-developers/GitPython/releases) and publish a new one with the recently pushed tag. Generate the changelog.
0 commit comments