From f57a2a2e963e8c892b75f5c593696aff814fa1cf Mon Sep 17 00:00:00 2001 From: mrava87 Date: Thu, 5 Oct 2023 19:42:31 +0300 Subject: [PATCH 1/8] fix: change handling of version in pyproject.toml/setup.cfg Setup parameters are moved to pyproject.toml as the current setup installs pylops0.0.0 (does not recognize the correct version). --- pyproject.toml | 47 +++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 53 -------------------------------------------------- 2 files changed, 46 insertions(+), 54 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8fd8d67e..c93b77fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,48 @@ [build-system] -requires = ["setuptools", "setuptools-scm"] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" + +[project] +name = "pylops" +description = "Python library implementing linear operators to allow solving large-scale optimization problems" +readme = "README.md" +authors = [ + {name = "Matteo Ravasi", email = "matteoravasi@gmail.com"}, +] +license = {file = "LICENSE.md"} +keywords = ["algebra", "inverse problems", "large-scale optimization"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Intended Audience :: Education", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Scientific/Engineering : Mathematics", +] +dependencies = [ + "numpy >= 1.21.0", + "scipy >= 1.4.0", +] +dynamic = ["version"] + +[project.optional-dependencies] +advanced = [ + "llvmlite", + "numba", + "pyfftw", + "PyWavelets", + "scikit-fmm", + "spgl1", +] + +[tool.setuptools.packages.find] +exclude = ["pytests"] + +[tool.setuptools_scm] +version_file = "pylops/version.py" diff --git a/setup.cfg b/setup.cfg index 67636c69..4c13f09c 100755 --- a/setup.cfg +++ b/setup.cfg @@ -1,56 +1,3 @@ -[metadata] -name = pylops -fullname = PyLops -description = Python library implementing linear operators to allow solving large-scale optimization problems -long_description = file: README.md -long_description_content_type = text/markdown -author = The PyLops Development Team -author_email = matteoravasi@gmail.com -maintainer = "Matteo Ravasi" -maintainer_email = matteoravasi@gmail.com -license = LGPL-3.0 License -license_file = LICENSE.md -platform = any -keywords = algebra, inverse problems, large-scale optimization -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - Intended Audience :: Science/Research - Intended Audience :: Education - License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3), - Natural Language :: English - Operating System :: OS Independent - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Topic :: Scientific/Engineering : Mathematics -url = https://github.com/pylops/pylops - -project_urls = - Documentation = https://pylops.readthedocs.io/ - Release Notes = https://github.com/pylops/pylops/releases - Bug Tracker = https://github.com/pylops/pylops/issues - Source Code = https://github.com/pylops/pylops - -[options] -zip_safe = True -include_package_data = True -packages = find: -python_requires = >=3.8 -install_requires = - numpy >= 1.21.0 - scipy >= 1.4.0 - -[options.extras_require] -advanced = - llvmlite - numba - pyfftw - PyWavelets - scikit-fmm - spgl1 - [aliases] test=pytest From 130cc2925bd6d1a990833327d40c923fe6f580ae Mon Sep 17 00:00:00 2001 From: mrava87 Date: Thu, 5 Oct 2023 19:58:11 +0300 Subject: [PATCH 2/8] minor: fix setuptools version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c93b77fb..848c54c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] +requires = ["setuptools>=60", "setuptools-scm>=8.0"] build-backend = "setuptools.build_meta" [project] From 385b10888678b64a2db5dff6993f6d3b39094913 Mon Sep 17 00:00:00 2001 From: mrava87 Date: Thu, 5 Oct 2023 20:04:25 +0300 Subject: [PATCH 3/8] minor: try to fetch versions --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 63b4a4e3..2e7a8adc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,6 +23,8 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements-dev.txt; fi - name: Install pylops run: | + git fetch --all --tags + python -m setuptools_scm pip install . - name: Test with pytest run: | From 30d421799bb64f58a56839abcaec30fde09dced1 Mon Sep 17 00:00:00 2001 From: mrava87 Date: Thu, 5 Oct 2023 20:12:57 +0300 Subject: [PATCH 4/8] minor: change of versions of setuptools --- .github/workflows/build.yaml | 2 +- pyproject.toml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2e7a8adc..01cf1705 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,7 +23,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements-dev.txt; fi - name: Install pylops run: | - git fetch --all --tags + git pull --tags python -m setuptools_scm pip install . - name: Test with pytest diff --git a/pyproject.toml b/pyproject.toml index 848c54c8..4deee5a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,9 @@ [build-system] -requires = ["setuptools>=60", "setuptools-scm>=8.0"] +requires = [ + "setuptools >= 65", + "setuptools_scm[toml]", + "wheel", +] build-backend = "setuptools.build_meta" [project] From 2a471d9482bb8bb24c2b9a8dc1a20bd87f2ba123 Mon Sep 17 00:00:00 2001 From: mrava87 Date: Thu, 5 Oct 2023 20:18:47 +0300 Subject: [PATCH 5/8] minor: add fetch of versions --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 01cf1705..0408ec17 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,7 +23,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements-dev.txt; fi - name: Install pylops run: | - git pull --tags + git fetch --tags python -m setuptools_scm pip install . - name: Test with pytest From 0ba2276387716c0db4787ad87385e2863a157fdb Mon Sep 17 00:00:00 2001 From: mrava87 Date: Thu, 5 Oct 2023 20:35:24 +0300 Subject: [PATCH 6/8] minor: Update setuptools --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0408ec17..d75a4005 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,7 +18,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements-dev.txt; fi - name: Install pylops From de821eb786ba6b2426700edc78c51225d63b9745 Mon Sep 17 00:00:00 2001 From: mrava87 Date: Thu, 5 Oct 2023 20:55:06 +0300 Subject: [PATCH 7/8] minor: Workaround in GA to get right version with SCM --- .github/workflows/build.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d75a4005..027d5bc2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,6 +12,10 @@ jobs: runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v3 + - name: Get history and tags for SCM versioning to work + run: | + git fetch --prune --unshallow + git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From a98d82666237f04d1993db6355e31bf8dd36ce98 Mon Sep 17 00:00:00 2001 From: mrava87 Date: Thu, 5 Oct 2023 20:56:02 +0300 Subject: [PATCH 8/8] minor: Workaround in GA to get right version with SCM --- .github/workflows/build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 027d5bc2..abf7ff7e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,7 +27,6 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements-dev.txt; fi - name: Install pylops run: | - git fetch --tags python -m setuptools_scm pip install . - name: Test with pytest