diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 4aa7446..a8d4a0d 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -176,7 +176,11 @@ jobs: release: name: "🚀 GitHub Release" runs-on: ubuntu-latest - needs: [build-macos, build-python-wheel, build-ubuntu, build-windows] + needs: + - build-macos + - build-python-wheel + - build-ubuntu + - build-windows if: startsWith(github.ref, 'refs/tags/') @@ -208,6 +212,7 @@ jobs: - name: Release uses: softprops/action-gh-release@v2 with: + discussion_category_name: announcements fail_on_unmatched_files: true files: builds/**/* generate_release_notes: true @@ -215,7 +220,13 @@ jobs: release-pypi: name: "🐍 Release on PyPI" runs-on: ubuntu-latest - needs: [build-python-wheel] + needs: + - build-python-wheel + environment: + name: pypi + url: https://pypi.org/project/geotribu/ + permissions: + id-token: write if: startsWith(github.ref, 'refs/tags/') @@ -230,12 +241,15 @@ jobs: if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_API_TOKEN }} + packages-dir: builds/wheel + print-hash: true release-ghcr: name: "🐳 Release as Docker container" runs-on: ubuntu-latest - needs: [release, release-pypi] + needs: + - release + - release-pypi env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} diff --git a/setup.cfg b/setup.cfg index c60d78c..84feb0d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -61,6 +61,11 @@ norecursedirs = .* build dev development dist docs CVS fixtures _darcs {arch} *. python_files = test_*.py testpaths = tests +[tool.pytest.ini_options] +retries = 2 +retry_delay = 0.5 +cumulative_timing = false + [coverage:run] branch = True omit = diff --git a/setup.py b/setup.py index 1dd193d..d22a57d 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ def load_requirements(requirements_files: Union[Path, list[Path]]) -> list: long_description=README, long_description_content_type="text/markdown", keywords=__about__.__keywords__, - url=__about__.__uri__, + url=__about__.__uri_homepage__, project_urls={ "Docs": __about__.__uri_homepage__, "Bug Reports": __about__.__uri_tracker__, diff --git a/tests/test_cli.py b/tests/test_cli.py index ade07a8..3c1f0c6 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -78,10 +78,21 @@ def test_cli_run_comments_open(capsys): assert Path(Path().home() / ".geotribu/comments/latest.json").exists() -@pytest.mark.flaky(retries=3, delay=1, only_on=[SystemExit]) +@pytest.mark.flaky(retries=3, delay=5, only_on=[SystemExit]) def test_cli_run_comments_open_specific(capsys): """Test nested subcommand comments latest.""" - cli.main(["comments", "open", "--page-size", "25", "--comment-id", "15"]) + cli.main( + [ + "comments", + "open", + "--page-size", + "25", + "--comment-id", + "15", + "--expiration-rotating-hours", + "0", + ] + ) out, err = capsys.readouterr() diff --git a/tests/test_mastodon_client.py b/tests/test_mastodon_client.py index 1ca4508..2869bde 100644 --- a/tests/test_mastodon_client.py +++ b/tests/test_mastodon_client.py @@ -10,6 +10,7 @@ # standard import unittest +from os import getenv from pathlib import Path from tempfile import TemporaryDirectory @@ -17,9 +18,6 @@ from geotribu_cli.__about__ import __title_clean__, __version__ from geotribu_cli.social.mastodon_client import ExtendedMastodonClient -# 3rd party - - # ############################################################################ # ########## Classes ############# # ################################ @@ -58,6 +56,10 @@ def test_instance_domain_from_url(self): "mapstodon.space", ) + @unittest.skipIf( + condition=getenv("GEOTRIBU_MASTODON_API_ACCESS_TOKEN") is None, + reason="Le jeton d'API Mastodon est requis pour exécuter ce test.", + ) def test_export_data_all(self): """Test export following accounts to CSV.""" masto_client = ExtendedMastodonClient(