From f1ddf0155ce22041b2db19cdf902e30e0db97c54 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Sun, 17 Sep 2023 08:55:21 -0400 Subject: [PATCH 1/7] Update ci, in line with gitdb This updates smmap's CI configuration in ways that are in line with recent updates to gitdb's. In most cases there is no difference in the changes, and the reason for the updates is more to avoid confusing differences than from the value of the changes themselves. In one case, there is a major difference (fetch-depth). - https://github.com/gitpython-developers/gitdb/pull/89 (same) - https://github.com/gitpython-developers/gitdb/pull/90 (same) It's just the project, not dependencies, but otherwise the same. - https://github.com/gitpython-developers/gitdb/pull/92 (opposite) This is the major difference. We don't need more than the tip of the branch in these tests. Keeping the default fetch-depth of 1 by not setting it explicitly avoids giving the impression that the tests here are doing something they are not (and also serves as a speed optimization). - https://github.com/gitpython-developers/gitdb/pull/93 (same) --- .github/dependabot.yml | 6 ++++++ .github/workflows/pythonpackage.yml | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..203f3c8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 7361358..7e21bb9 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -16,19 +16,23 @@ jobs: strategy: matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + include: + - experimental: false + - python-version: "3.12" + experimental: true + continue-on-error: ${{ matrix.experimental }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 1000 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - allow-prereleases: true - - name: Install dependencies + allow-prereleases: ${{ matrix.experimental }} + - name: Install project run: | python -m pip install --upgrade pip + pip install . - name: Lint with flake8 run: | pip install flake8 From 69cd90ff968bd466b26d52859e5a850b6ce300b1 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Tue, 3 Oct 2023 13:09:45 -0400 Subject: [PATCH 2/7] Run CI on all branches + Make YAML indentation more consistent. --- .github/workflows/pythonpackage.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 7e21bb9..28054ea 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -3,11 +3,7 @@ name: Python package -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [push, pull_request, workflow_dispatch] jobs: build: @@ -17,9 +13,9 @@ jobs: matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] include: - - experimental: false - - python-version: "3.12" - experimental: true + - experimental: false + - python-version: "3.12" + experimental: true continue-on-error: ${{ matrix.experimental }} steps: From 44ac30a7481a619e32b13a4efc1de0479b1b4379 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Tue, 3 Oct 2023 13:11:57 -0400 Subject: [PATCH 3/7] No longer treat 3.12 as experimental on CI Since Python 3.12.0 stable has been released and is available via setup-python, per: https://github.com/actions/python-versions/blob/main/versions-manifest.json This makes it so continue-on-error and allow-prereleases are no longer special-cased to true for 3.12; instead, 3.12 is treaed the same as other Python releases (where those are false). --- .github/workflows/pythonpackage.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 28054ea..e816355 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -14,8 +14,6 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] include: - experimental: false - - python-version: "3.12" - experimental: true continue-on-error: ${{ matrix.experimental }} steps: From 36dd418b05f962569fd894d4edf533fc8d7c5bed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 02:10:45 +0000 Subject: [PATCH 4/7] Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e816355..fd73d6d 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} allow-prereleases: ${{ matrix.experimental }} From a315725c68295a02f3d007409ea3101430543289 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Wed, 13 Dec 2023 03:04:54 -0500 Subject: [PATCH 5/7] Replace use of mktemp This uses NamedTemporaryFile with delete=False to replace the one use of the deprecated mktemp function in smmap (reported in #41). This avoids the race condition inherent to mktemp, as the file is named and created together in a way that is effectively atomic. Because NamedTemporaryFile is not being used to automatically delete the file, it use and cleanup are unaffected by the change. --- smmap/test/lib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/smmap/test/lib.py b/smmap/test/lib.py index ca91ee9..b15b0ec 100644 --- a/smmap/test/lib.py +++ b/smmap/test/lib.py @@ -18,12 +18,12 @@ class FileCreator: def __init__(self, size, prefix=''): assert size, "Require size to be larger 0" - self._path = tempfile.mktemp(prefix=prefix) self._size = size - with open(self._path, "wb") as fp: - fp.seek(size - 1) - fp.write(b'1') + with tempfile.NamedTemporaryFile("wb", prefix=prefix, delete=False) as file: + self._path = file.name + file.seek(size - 1) + file.write(b'1') assert os.path.getsize(self.path) == size From f71bbd48fa80f5f4408f24be76e7739b2d860b91 Mon Sep 17 00:00:00 2001 From: Maximilian Wirtz Date: Thu, 25 Jan 2024 15:01:51 +0100 Subject: [PATCH 6/7] Use SPDX identifier BSD is amiguous. So let's use the correct SPDX identifier. https://spdx.org/licenses/ --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 49d90a0..d7e1842 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ author_email=smmap.__contact__, url=smmap.__homepage__, platforms=["any"], - license="BSD", + license="BSD-3-Clause", packages=find_packages(), zip_safe=True, python_requires=">=3.7", From f31bfa378c8840d38d31e7e11ef2b84f191a491e Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 2 Jan 2025 08:04:16 +0100 Subject: [PATCH 7/7] bump patch level prior to new release --- doc/source/changes.rst | 6 ++++++ smmap/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 947c71a..dc243eb 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -2,6 +2,12 @@ Changelog ######### +****** +v5.0.2 +****** + +- remove a usage of mktemp + ****** v5.0.1 ****** diff --git a/smmap/__init__.py b/smmap/__init__.py index 429f47a..657c8c5 100644 --- a/smmap/__init__.py +++ b/smmap/__init__.py @@ -3,7 +3,7 @@ __author__ = "Sebastian Thiel" __contact__ = "byronimo@gmail.com" __homepage__ = "https://github.com/gitpython-developers/smmap" -version_info = (5, 0, 1) +version_info = (5, 0, 2) __version__ = '.'.join(str(i) for i in version_info) # make everything available in root package for convenience