From d700e6af3a3441b1104f748fac63a9a5848a1a8e Mon Sep 17 00:00:00 2001 From: oasaph Date: Tue, 3 Jun 2025 13:54:30 -0300 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=8A=20Add=20verbose=20option=20to?= =?UTF-8?q?=20PyPI=20publish=20step=20for=20detailed=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 8e7cb4b..133dfaa 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -68,3 +68,4 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: dist/ + verbose: true From 5c079a92c55603d5451819afbb907af9ef2ec879 Mon Sep 17 00:00:00 2001 From: oasaph Date: Tue, 3 Jun 2025 14:01:17 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=E2=8F=AA=20Revert=20package=20to=20python?= =?UTF-8?q?=5Fflaggle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- {flaggle => python_flaggle}/__init__.py | 4 ++-- {flaggle => python_flaggle}/flag.py | 0 {flaggle => python_flaggle}/flaggle.py | 2 +- tests/test_flag.py | 4 ++-- tests/test_flaggle.py | 10 +++++----- tests/test_flaggle_extra.py | 16 ++++++++-------- 7 files changed, 19 insertions(+), 19 deletions(-) rename {flaggle => python_flaggle}/__init__.py (57%) rename {flaggle => python_flaggle}/flag.py (100%) rename {flaggle => python_flaggle}/flaggle.py (98%) diff --git a/pyproject.toml b/pyproject.toml index a932658..f7b281f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "flaggle" +name = "python_flaggle" version = "0.2.0" description = "" authors = [ diff --git a/flaggle/__init__.py b/python_flaggle/__init__.py similarity index 57% rename from flaggle/__init__.py rename to python_flaggle/__init__.py index 20f9251..415c558 100644 --- a/flaggle/__init__.py +++ b/python_flaggle/__init__.py @@ -1,5 +1,5 @@ -from flaggle.flaggle import Flaggle -from flaggle.flag import Flag, FlagOperation, FlagType +from python_flaggle.flaggle import Flaggle +from python_flaggle.flag import Flag, FlagOperation, FlagType __all__ = ["FlagType", "FlagOperation", "Flag", "Flaggle"] __version__ = "0.2.0" diff --git a/flaggle/flag.py b/python_flaggle/flag.py similarity index 100% rename from flaggle/flag.py rename to python_flaggle/flag.py diff --git a/flaggle/flaggle.py b/python_flaggle/flaggle.py similarity index 98% rename from flaggle/flaggle.py rename to python_flaggle/flaggle.py index 2f09d90..98e9d23 100644 --- a/flaggle/flaggle.py +++ b/python_flaggle/flaggle.py @@ -7,7 +7,7 @@ from requests import RequestException, get -from flaggle.flag import Flag +from python_flaggle.flag import Flag logger = getLogger(__name__) diff --git a/tests/test_flag.py b/tests/test_flag.py index 8b94880..7e0d37e 100644 --- a/tests/test_flag.py +++ b/tests/test_flag.py @@ -2,7 +2,7 @@ from pytest import raises -from flaggle import Flag, FlagOperation, FlagType +from python_flaggle import Flag, FlagOperation, FlagType class TestFlagType: @@ -311,7 +311,7 @@ def test_from_json_no_flag_name(self): ] } - with patch("flaggle.flag.logger.warning") as mock_warning: + with patch("python_flaggle.flag.logger.warning") as mock_warning: flag = Flag.from_json(json_data) assert flag == {} mock_warning.assert_called_once_with("Found flag without name, skipping") diff --git a/tests/test_flaggle.py b/tests/test_flaggle.py index 23caa2c..3d9ccbb 100644 --- a/tests/test_flaggle.py +++ b/tests/test_flaggle.py @@ -2,12 +2,12 @@ from unittest.mock import Mock, patch -from flaggle import Flag, Flaggle +from python_flaggle import Flag, Flaggle class TestFlaggle: def test_init(self): - with patch("flaggle.flaggle.get") as mock_get: + with patch("python_flaggle.flaggle.get") as mock_get: mock_response = Mock() mock_response.status_code = 200 mock_response.json.return_value = { @@ -76,7 +76,7 @@ def status_code(self): def text(self): return '{"flags": [{"name": "flag1", "value": true}]}' - monkeypatch.setattr("flaggle.flaggle.get", lambda *a, **k: MockResponse()) + monkeypatch.setattr("python_flaggle.flaggle.get", lambda *a, **k: MockResponse()) flags = self.flaggle._fetch_flags() assert "flag1" in flags @@ -86,7 +86,7 @@ def raise_exc(*a, **k): raise RequestException("fail") - monkeypatch.setattr("flaggle.flaggle.get", raise_exc) + monkeypatch.setattr("python_flaggle.flaggle.get", raise_exc) assert self.flaggle._fetch_flags() == {} def test_fetch_flags_key_error(self, monkeypatch): @@ -105,7 +105,7 @@ def status_code(self): def text(self): return "{}" - monkeypatch.setattr("flaggle.flaggle.get", lambda *a, **k: MockResponse()) + monkeypatch.setattr("python_flaggle.flaggle.get", lambda *a, **k: MockResponse()) assert self.flaggle._fetch_flags() == {} def test_update_with_data(self, monkeypatch): diff --git a/tests/test_flaggle_extra.py b/tests/test_flaggle_extra.py index 43a717f..d7c07d7 100644 --- a/tests/test_flaggle_extra.py +++ b/tests/test_flaggle_extra.py @@ -1,7 +1,7 @@ import threading from unittest.mock import MagicMock, patch -from flaggle import Flag, Flaggle +from python_flaggle import Flag, Flaggle def test_flaggle_init_sets_last_update_and_flags(monkeypatch): @@ -21,7 +21,7 @@ def status_code(self): def text(self): return '{"flags": [{"name": "flag", "value": true}]}' - monkeypatch.setattr("flaggle.flaggle.get", lambda *a, **k: MockResponse()) + monkeypatch.setattr("python_flaggle.flaggle.get", lambda *a, **k: MockResponse()) f = Flaggle("http://x", interval=1, default_flags={"f": Flag("f", True)}) assert isinstance(f.last_update, type(f._last_update)) assert isinstance(f.flags, dict) @@ -29,7 +29,7 @@ def text(self): def test_flaggle_update_uses_default_flags_on_empty(monkeypatch): monkeypatch.setattr( - "flaggle.flaggle.get", + "python_flaggle.flaggle.get", lambda *a, **k: MagicMock( json=lambda: {"flags": []}, raise_for_status=lambda: None, @@ -40,14 +40,14 @@ def test_flaggle_update_uses_default_flags_on_empty(monkeypatch): f = Flaggle("http://x", interval=1, default_flags={"f": Flag("f", True)}) # forcibly clear flags to test fallback f._flags = {"f": Flag("f", True)} - with patch("flaggle.flaggle.Flag.from_json", return_value={}): + with patch("python_flaggle.flaggle.Flag.from_json", return_value={}): f._update() assert f._flags == {"f": Flag("f", True)} or f._flags == {} def test_flaggle_schedule_update_starts_thread(monkeypatch): monkeypatch.setattr( - "flaggle.flaggle.get", + "python_flaggle.flaggle.get", lambda *a, **k: MagicMock( json=lambda: {"flags": []}, raise_for_status=lambda: None, @@ -63,7 +63,7 @@ def test_flaggle_schedule_update_starts_thread(monkeypatch): def test_flaggle_recurring_update_calls(monkeypatch): monkeypatch.setattr( - "flaggle.flaggle.get", + "python_flaggle.flaggle.get", lambda *a, **k: MagicMock( json=lambda: {"flags": []}, raise_for_status=lambda: None, @@ -86,14 +86,14 @@ def raise_exc(*a, **k): raise RequestException("fail") - monkeypatch.setattr("flaggle.flaggle.get", raise_exc) + monkeypatch.setattr("python_flaggle.flaggle.get", raise_exc) f = Flaggle("http://x", interval=1, default_flags={"f": Flag("f", True)}) assert f._fetch_flags() == {} def test_flaggle_properties(monkeypatch): monkeypatch.setattr( - "flaggle.flaggle.get", + "python_flaggle.flaggle.get", lambda *a, **k: MagicMock( json=lambda: {"flags": []}, raise_for_status=lambda: None,