Skip to content

Improve Python version and OS compatibility, fixing deprecations #1654

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

Merged
merged 17 commits into from
Sep 12, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update installation instructions in readme
This changes the installation instructions in README.md to
recommend "pip install ." instead of "python setup.py install". The
former is compatible with Python 3.12 which doesn't have setuptools
installed by default (so setup.py, which imports it, can be
indirectly but not directly used). This also matches the
corresponding change made in the installation unit test.

While doing so, I've also clarified the instructions, and added the
implied "cd" command as well as the "git fetch --tags" command in
the position where a later section was recently updated to mention
it should have been run.

Using "pip install ." creates the opportunity to pass "-e" to make
an editable install, which users who clone the repository to work
on changes should do, because the effect of an editable install is
only partially simulated by pytest, and so that manual testing of
changes actually uses the changes intended for testing.

This increases the length and detail of the instructions, so I've
added h4 subsections to clarify the separations between them and
make it easier for readers to find the part they're looking for. In
doing so, I've reordered these subsections accordingly. Because
greater detail can create the impression that all important steps
are mentioned, I've made the general good advice to use a virtual
environment explicit. For brevity, I have not added venv commands.
  • Loading branch information
EliahKagan committed Sep 10, 2023
commit 72e48aaea59738172ded5c964ddb4f06233ce9b7
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,49 @@ The installer takes care of installing them for you.

### INSTALL

If you have downloaded the source code:
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).

```bash
python setup.py install
```
#### From PyPI

or if you want to obtain a copy from the Pypi repository:
To obtain and install a copy [from PyPI](https://pypi.org/project/GitPython/), run:

```bash
pip install GitPython
```

Both commands will install the required package dependencies.
(A distribution package can also be downloaded for manual installation at [the PyPI page](https://pypi.org/project/GitPython/).)

#### From downloaded source code

If you have downloaded the source code, run this from inside the unpacked `GitPython` directory:

A distribution package can be obtained for manual installation at: <http://pypi.python.org/pypi/GitPython>.
```bash
pip install .
```

If you like to clone from source, you can do it like so:
#### By cloning the source code repository

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:

```bash
git clone https://github.com/gitpython-developers/GitPython
git submodule update --init --recursive
cd GitPython
git fetch --tags
./init-tests-after-clone.sh
```

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

```bash
gh repo clone GitPython
```

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

```bash
pip install -e .
```

### Limitations

#### Leakage of System Resources
Expand Down