◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
43 changes: 29 additions & 14 deletions .github/workflows/cygwin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,53 @@ jobs:
SHELLOPTS: igncr
TMP: "/tmp"
TEMP: "/tmp"

steps:
- name: Force LF line endings
run: git config --global core.autocrlf input
- uses: actions/checkout@v4
with:
fetch-depth: 9999
- uses: cygwin/cygwin-install-action@v4
with:
packages: python39 python39-pip python39-virtualenv git
- name: Tell git to trust this repo
shell: bash.exe -eo pipefail -o igncr "{0}"
run: |
/usr/bin/git config --global --add safe.directory "$(pwd)"
- name: Install dependencies and prepare tests
shell: bash.exe -eo pipefail -o igncr "{0}"
run: |
set -x
/usr/bin/python -m pip install --upgrade pip setuptools wheel
/usr/bin/python --version; /usr/bin/git --version
/usr/bin/git submodule update --init --recursive
/usr/bin/git fetch --tags
/usr/bin/python -m pip install -r requirements.txt
/usr/bin/python -m pip install -r test-requirements.txt
TRAVIS=yes ./init-tests-after-clone.sh
/usr/bin/git config --global user.email "travis@ci.com"
/usr/bin/git config --global user.name "Travis Runner"
# If we rewrite the user's config by accident, we will mess it up
# and cause subsequent tests to fail
cat test/fixtures/.gitconfig >> ~/.gitconfig
- name: Test with pytest
shell: bash.exe -eo pipefail -o igncr "{0}"
run: |
/usr/bin/python -m pytest
continue-on-error: false
53 changes: 36 additions & 17 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,70 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 9999
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and prepare tests
run: |
set -x

python -m pip install --upgrade pip setuptools wheel
python --version; git --version
git submodule update --init --recursive
git fetch --tags --force

pip install -r requirements.txt
pip install -r test-requirements.txt
TRAVIS=yes ./init-tests-after-clone.sh

git config --global user.email "travis@ci.com"
git config --global user.name "Travis Runner"
# If we rewrite the user's config by accident, we will mess it up
# and cause subsequent tests to fail
cat test/fixtures/.gitconfig >> ~/.gitconfig

- name: Check types with mypy
# With new versions of pypi new issues might arise. This is a problem if there is nobody able to fix them,
# so we have to ignore errors until that changes.
continue-on-error: true
run: |
set -x
mypy -p git

- name: Test with pytest
run: |
set -x
pytest
continue-on-error: false

- name: Documentation
run: |
set -x
pip install -r doc/requirements.txt
make -C doc html
98 changes: 75 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,51 @@ The installer takes care of installing them for you.

### INSTALL

If you have downloaded the source code:

```bash
python setup.py install
```

or if you want to obtain a copy from the Pypi repository:

```bash
pip install GitPython
```

Both commands will install the required package dependencies.

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

If you like to clone from source, you can do it like so:

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

### Limitations

#### Leakage of System Resources
Expand Down Expand Up @@ -101,20 +122,49 @@ On _Windows_, make sure you have `git-daemon` in your PATH. For MINGW-git, the `
exists in `Git\mingw64\libexec\git-core\`; CYGWIN has no daemon, but should get along fine
with MINGW's.

Ensure testing libraries are installed.
In the root directory, run: `pip install -r test-requirements.txt`

To lint, run: `pre-commit run --all-files`

To typecheck, run: `mypy -p git`

To test, run: `pytest`

For automatic code formatting run: `black git`

Configuration for flake8 is in the ./.flake8 file.

Configurations for mypy, pytest and coverage.py are in ./pyproject.toml.

The same linting and testing will also be performed against different supported python versions
upon submitting a pull request (or on each push if you have a fork with a "main" branch and actions enabled).
Expand All @@ -138,13 +188,15 @@ Please have a look at the [contributions file][contributing].

### How to make a new release

- Update/verify the **version** in the `VERSION` file
- Update/verify that the `doc/source/changes.rst` changelog file was updated
- Commit everything
- Run `git tag -s <version>` to tag the version in Git
- Run `make release`
- Close the milestone mentioned in the _changelog_ and create a new one. _Do not reuse milestones by renaming them_.
- Got to [GitHub Releases](https://github.com/gitpython-developers/GitPython/releases) and publish a new one with the recently pushed tag. Generate the changelog.

### How to verify a release (DEPRECATED)

Expand Down
8 changes: 8 additions & 0 deletions doc/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog
=========

3.1.35
======

Expand Down
8 changes: 5 additions & 3 deletions init-tests-after-clone.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash -e

if [[ -z "$TRAVIS" ]]; then
read -p "This operation will destroy locally modified files. Continue ? [N/y]: " answer
if [[ ! $answer =~ [yY] ]]; then
exit 2
fi
@@ -13,4 +15,4 @@ git reset --hard HEAD~1
git reset --hard HEAD~1
git reset --hard HEAD~1
git reset --hard __testing_point__
git submodule update --init --recursive
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# libraries for additional local testing/linting - to be added to test-requirements.txt when all pass

flake8-type-checking;python_version>="3.8" # checks for TYPE_CHECKING only imports
black

pytest-icdiff
# pytest-profiling
Expand Down
Loading
Toggle all file notes Toggle all file annotations