From ce44a24e49d6cd3187d52665236f315ab250c14e Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sat, 19 Oct 2024 00:47:56 +0200 Subject: [PATCH 1/9] Hopefully fix CI --- .github/workflows/publish.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c6e3826..e1e0973 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -42,6 +42,15 @@ jobs: - name: Check metadata verification run: python -m twine check --strict dist/* + - name: Upload artifact with distribution files + uses: actions/upload-artifact@v4 + with: + name: distro-files + path: dist/ + if-no-files-found: warn + retention-days: 1 # delete the artifact after 1 day, no need to keep it for too long + compression-level: 0 # no need to compress the files + publish-distribution: name: Upload distribution to PyPI runs-on: ubuntu-latest @@ -53,5 +62,11 @@ jobs: # permission mandatory for trusted publishing id-token: write steps: + - name: Download artifact with distribution files + uses: actions/download-artifact@v4 + with: + name: distro-files + path: dist/ + - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From afefc1c725acb84b5d0d3fe64145dccec9ca41b8 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 20 Oct 2024 18:20:39 +0100 Subject: [PATCH 2/9] Improve maintenance instructions --- docs/conf.py | 7 +++++++ docs/contribute/contributing.rst | 16 +++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2381436..555741e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,6 +51,13 @@ # suppress unreferenced footnote warnings suppress_warnings = ["ref.footnote"] +# rst Prolog is included at the beginning of every source file that is read. +# This is useful for substitutions and other things that should be available in +# every file, such as project-specific links. +rst_prolog = """ +.. _PyPI_project: https://pypi.org/project/pvpltools/ +""" + # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output diff --git a/docs/contribute/contributing.rst b/docs/contribute/contributing.rst index 9327a48..19dcf65 100644 --- a/docs/contribute/contributing.rst +++ b/docs/contribute/contributing.rst @@ -170,12 +170,13 @@ follow these steps: 0. Make sure changelog entries are up-to-date and the code is ready for release. 1. Push a new tag with the version number and the pre-release suffix, e.g., ``v0.1.0a1``. -2. The GitHub Actions workflow will automatically publish the pre-release to PyPI. This is the most important step, as it will test the package installation. +2. The GitHub Actions workflow will automatically publish the pre-release to PyPI. This is the most important step, as it will test the package installation. Check it gets published correctly on PyPI. + `PyPI project link `_. 3. (Optionally) Install the pre-release with pip: - .. code-block:: bash +.. code-block:: bash - pip install --pre pvpltools + pip install --pre pvpltools 4. (Optionally) Announce the pre-release, e.g., on the GitHub "Releases" tab. You may link to the pre-release on PyPI, the documentation or copy&paste the changelog. @@ -186,12 +187,13 @@ To create a new release, follow these steps: 0. Make sure changelog entries and it's filename are up-to-date and the code is ready for release. 1. Push a new tag with the version number, e.g., ``v0.1.0``. -2. The GitHub Actions workflow will automatically publish the release to PyPI. +2. The GitHub Actions workflow will automatically publish the release to PyPI. Check it gets published correctly on PyPI. + `PyPI project link `_. 3. Install the release with pip: - .. code-block:: bash +.. code-block:: bash - pip install pvpltools + pip install pvpltools 4. Announce the release, e.g., on the GitHub "Releases" tab. You may link to the release on PyPI, the documentation or copy&paste the changelog. 5. After the release, add a new section to the changelog, e.g., ``docs/whatsnews/0.1.1.rst`` and list it in ``docs/whatsnews/_index.rst`` via ``.. include:: 0.1.1.rst`` on top of the list, to preserve the chronological order. You may make a copy of the template ``docs/whatsnews/_next_release_template.rst`` and fill in the details. @@ -208,4 +210,4 @@ For more information, you may want to check out: .. _release procedure: https://github.com/pvlib/pvlib-python/wiki/Release-procedures .. _keep_a_changelog_guide: https://keepachangelog.com/en/ -🌞*Have a bright coding day!* +🌞 *Have a bright coding day!* From 6eed68ed905720f0d839bc818c8ce59d5f5cc39e Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 20 Oct 2024 18:20:53 +0100 Subject: [PATCH 3/9] Add copybutton to code snippets --- docs/conf.py | 1 + pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 555741e..3798481 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -39,6 +39,7 @@ "sphinx_gallery.gen_gallery", "sphinx_toggleprompt", "sphinx_favicon", + "sphinx_copybutton", ] templates_path = ["templates"] diff --git a/pyproject.toml b/pyproject.toml index e146c4f..6725568 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,8 @@ docs = [ "pydata-sphinx-theme~=0.15", "sphinx-gallery~=0.18", "sphinx_toggleprompt~=0.5", - "sphinx_favicon~=1.0" + "sphinx_favicon~=1.0", + "sphinx-copybutton~=0.5", ] all = ["pvpltools[test,docs]"] From 44e1038c97f6490129e2f790b05ab083b1180617 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:48:47 +0100 Subject: [PATCH 4/9] remove file from original pvpltools --- pvpltools/requirements.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 pvpltools/requirements.txt diff --git a/pvpltools/requirements.txt b/pvpltools/requirements.txt deleted file mode 100644 index 1c813b6..0000000 --- a/pvpltools/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -numpy -pandas -scipy From 3cf824a6fa6f55c231b6fe1fb455da4192c55c07 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:49:23 +0100 Subject: [PATCH 5/9] fix broken links in PyPI project urls --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6725568..1464f93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,8 +46,8 @@ all = ["pvpltools[test,docs]"] [project.urls] "Homepage" = "https://pvpltools.readthedocs.io/en/latest/" "Documentation" = "https://pvpltools.readthedocs.io/en/latest/" -"Repository" = "https://github.com/pvlabs/pvpltools" -"Bug Tracker" = "https://github.com/pvlabs/pvpltools/issues" +"Repository" = "https://github.com/pvplabs/pvpltools" +"Bug Tracker" = "https://github.com/pvplabs/pvpltools/issues" "Changelog" = "https://pvpltools.readthedocs.io/en/latest/" [tool.setuptools_scm] From ac24a59dcefebcb8cde7b3e3bfbab808f2ceaa7a Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 25 Oct 2024 18:50:29 +0100 Subject: [PATCH 6/9] =?UTF-8?q?Exclude=20files=20from=20sdist=20and=20bdis?= =?UTF-8?q?t=20=C3=A0=20la=20pvlib#2277?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MANIFEST.in | 9 +++++++++ pyproject.toml | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..502bb80 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,9 @@ +# This file defines which files should be included in the source distribution (.tar.gz) +# and, in conjuntion with pyproject.toml, affects the files included in the wheel distribution (.whl) +# See https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html for reference [2024-10-25] + +# By default, all VCS-tracked files are included, so let's exclude unwanted files +prune .github +prune ci +exclude .git* +exclude .readthedocs.yaml diff --git a/pyproject.toml b/pyproject.toml index 1464f93..0ac0e54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,16 @@ all = ["pvpltools[test,docs]"] "Bug Tracker" = "https://github.com/pvplabs/pvpltools/issues" "Changelog" = "https://pvpltools.readthedocs.io/en/latest/" +# Control which files are included in the built distribution +# https://setuptools.pypa.io/en/latest/userguide/datafiles.html [2024-10-25] +[tool.setuptools] +include-package-data = true # inclusion of non-python files in the package folder (like data files) [default: true] +[tool.setuptools.packages.find] +include = ["pvpltools*"] +exclude = ["pvpltools.test*"] +[tool.setuptools.exclude-package-data] +pvpltools = ["test/*"] # exclude test folder from the package + [tool.setuptools_scm] [tool.flake8] From f1b23ab1a9fef6aaebf1d704f86eb3ac1a211cc4 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:10:57 +0000 Subject: [PATCH 7/9] Update publish.yml --- .github/workflows/publish.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e1e0973..4358d16 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -51,6 +51,17 @@ jobs: retention-days: 1 # delete the artifact after 1 day, no need to keep it for too long compression-level: 0 # no need to compress the files + - name: Distribution files & installation sizes + run: | + echo "Distribution files sizes" + du -sh dist/* + python -m pip install dist/*.whl --target /tmp/pvpltools + echo "Installation sizes" + du -sh /tmp/pvpltools + + - name: Verify installation + run: python -c "import pvpltools" + publish-distribution: name: Upload distribution to PyPI runs-on: ubuntu-latest From c6a0587c002a09fb67191e9b362643a37bee99bd Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:17:19 +0000 Subject: [PATCH 8/9] rm verify step --- .github/workflows/publish.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4358d16..e574bdb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -59,9 +59,6 @@ jobs: echo "Installation sizes" du -sh /tmp/pvpltools - - name: Verify installation - run: python -c "import pvpltools" - publish-distribution: name: Upload distribution to PyPI runs-on: ubuntu-latest From 845ed5b9b373fefae08f087191c817cfa1f88f62 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:21:10 +0000 Subject: [PATCH 9/9] Update publish.yml --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e574bdb..554c753 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -55,7 +55,7 @@ jobs: run: | echo "Distribution files sizes" du -sh dist/* - python -m pip install dist/*.whl --target /tmp/pvpltools + python -m pip install dist/*.whl --target /tmp/pvpltools --quiet --quiet echo "Installation sizes" du -sh /tmp/pvpltools