From e85ba80aa2d08a90367978901a74a7ddbd78ed6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 08:26:08 +0000 Subject: [PATCH 01/38] Bump actions/setup-python from 3 to 4 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test_and_publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index 330a0b5..d603809 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v3 - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} @@ -72,7 +72,7 @@ jobs: uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.x' @@ -101,7 +101,7 @@ jobs: uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.x' From 7fe8c12c684942798ceff0d0f60cd801b693e469 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 08:07:28 +0000 Subject: [PATCH 02/38] Update faker requirement from <14.0,>=4.1 to >=4.1,<16.0 Updates the requirements on [faker](https://github.com/joke2k/faker) to permit the latest version. - [Release notes](https://github.com/joke2k/faker/releases) - [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md) - [Commits](https://github.com/joke2k/faker/compare/v4.1.0...v15.0.0) --- updated-dependencies: - dependency-name: faker dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ebf11e6..d66cb11 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,7 @@ package_dir = =src python_requires = >=3.7, <4 install_requires = - Faker >= 4.1,< 14.0 + Faker >= 4.1,< 16.0 [options.packages.find] where = src From e19364d04c5befd61e8b12e58fa4f33e756dd9eb Mon Sep 17 00:00:00 2001 From: LGTM Migrator Date: Thu, 10 Nov 2022 11:25:40 +0000 Subject: [PATCH 03/38] Add CodeQL workflow for GitHub code scanning --- .github/workflows/codeql.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..365e727 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,41 @@ +name: "CodeQL" + +on: + push: + branches: [ "develop", "main" ] + pull_request: + branches: [ "develop" ] + schedule: + - cron: "56 4 * * 4" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ python ] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ matrix.language }}" From 4d302d41eeba5b8a38bf42e79a4d0ca12e30104c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:01:47 +0000 Subject: [PATCH 04/38] Update faker requirement from <16.0,>=4.1 to >=4.1,<17.0 Updates the requirements on [faker](https://github.com/joke2k/faker) to permit the latest version. - [Release notes](https://github.com/joke2k/faker/releases) - [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md) - [Commits](https://github.com/joke2k/faker/compare/v4.1.0...v16.4.0) --- updated-dependencies: - dependency-name: faker dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d66cb11..f312595 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,7 @@ package_dir = =src python_requires = >=3.7, <4 install_requires = - Faker >= 4.1,< 16.0 + Faker >= 4.1,< 17.0 [options.packages.find] where = src From ecc08adba89b85d48613258be299c897631cd0bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 08:57:35 +0000 Subject: [PATCH 05/38] Update faker requirement from <17.0,>=4.1 to >=4.1,<19.0 Updates the requirements on [faker](https://github.com/joke2k/faker) to permit the latest version. - [Release notes](https://github.com/joke2k/faker/releases) - [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md) - [Commits](https://github.com/joke2k/faker/compare/v4.1.0...v18.3.1) --- updated-dependencies: - dependency-name: faker dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index f312595..2d7a755 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,7 @@ package_dir = =src python_requires = >=3.7, <4 install_requires = - Faker >= 4.1,< 17.0 + Faker >= 4.1,< 19.0 [options.packages.find] where = src From 656c59a0277fa6f6bb13b75d2b5bd3bc3ed243e4 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 17 Jan 2024 19:58:20 +0100 Subject: [PATCH 06/38] Use latest images in CI workflows --- .github/workflows/test_and_publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index d603809..4f959de 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, macos-10.15] + os: [ubuntu-latest, macos-latest] python-version: - '3.7' - '3.8' @@ -37,7 +37,7 @@ jobs: test-docs: name: Test documentation - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: PYTHON_VERSION: 3.8 steps: @@ -61,7 +61,7 @@ jobs: publish-to-test-pypi: name: Publish to TestPyPI environment: staging - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' && github.event_name == 'push' needs: - test-code @@ -92,7 +92,7 @@ jobs: publish-to-pypi: name: Publish to PyPI environment: production - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' && github.event_name == 'push' needs: publish-to-test-pypi From ce222d4235036825dd9492047a55cd8392578d29 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:36:20 +0000 Subject: [PATCH 07/38] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/test_and_publish.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 365e727..ee0597b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index 4f959de..b195f7b 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -42,7 +42,7 @@ jobs: PYTHON_VERSION: 3.8 steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@v4 @@ -69,7 +69,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 @@ -98,7 +98,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 From 72a15c88aa29b95e4b8498e525d78461890d3007 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 08:30:56 +0000 Subject: [PATCH 08/38] Update faker requirement from <19.0,>=4.1 to >=4.1,<20.0 Updates the requirements on [faker](https://github.com/joke2k/faker) to permit the latest version. - [Release notes](https://github.com/joke2k/faker/releases) - [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md) - [Commits](https://github.com/joke2k/faker/compare/v4.1.0...v19.1.0) --- updated-dependencies: - dependency-name: faker dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2d7a755..761c8d6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,7 @@ package_dir = =src python_requires = >=3.7, <4 install_requires = - Faker >= 4.1,< 19.0 + Faker >= 4.1,< 20.0 [options.packages.find] where = src From e09fe35a6427efca788f6f1166f0dab266be50f2 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Thu, 18 Jan 2024 13:26:02 +0100 Subject: [PATCH 09/38] Replace 'assertTrue' with 'assertIn' --- tests/test_wifi_essid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_wifi_essid.py b/tests/test_wifi_essid.py index 83b5b23..6be65dd 100644 --- a/tests/test_wifi_essid.py +++ b/tests/test_wifi_essid.py @@ -42,7 +42,7 @@ def test_common_essid(self): """ for _ in range(10): - self.assertTrue(self.fake.common_essid() in COMMON_ESSIDS) + self.assertIn(self.fake.common_essid(), COMMON_ESSIDS) def test_upc_default_essid(self): """ From cda53540afa10c420f8a893fad124154684296cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:29:19 +0000 Subject: [PATCH 10/38] Bump github/codeql-action from 2 to 3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ee0597b..1f16b95 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -27,15 +27,15 @@ jobs: uses: actions/checkout@v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{ matrix.language }}" From 5e578a1cfc8c55731decf454a1f1f58670c31e4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:29:15 +0000 Subject: [PATCH 11/38] 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/test_and_publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index b195f7b..dcd38d4 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -23,7 +23,7 @@ jobs: 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 }} @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -72,7 +72,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' @@ -101,7 +101,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' From c91cd5c4423e0b6d3591605d3d8eaa702ca24562 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Tue, 16 May 2023 02:14:18 +0200 Subject: [PATCH 12/38] Remove 'requirements.txt' --- requirements.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9c558e3..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -. From 01c618aa77d6d805dfd5ef585dd4379a15d12957 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Tue, 16 May 2023 02:20:07 +0200 Subject: [PATCH 13/38] Replace Pylint and Flake8 with Ruff --- .pre-commit-config.yaml | 15 +++++++------- setup.cfg | 3 ++- tox.ini | 45 ++++++++++++++++++++++------------------- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af21586..9dbc275 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,17 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 8fe62d14e0b4d7d845a7022c5c2c3ae41bdd3f26 # frozen: v4.1.0 + rev: f71fa2c1f9cf5cb705f73dffe4b21f7c61470ba9 # frozen: v4.4.0 hooks: - id: check-ast - - id: check-executables-have-shebangs - id: check-yaml - id: trailing-whitespace - - repo: https://github.com/pycqa/flake8 - rev: cbeb4c9c4137cff1568659fcc48e8b85cddd0c8d # frozen: 4.0.1 + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: e812d61e6e9d269f44ecda63904ed670a1948fe8 # frozen: v0.0.257 hooks: - - id: flake8 + - id: ruff - - repo: https://github.com/pycqa/pylint - rev: eec287fae66f8fc514d5daa9caee46fd0e0cb6d9 # frozen: v2.12.2 + - repo: https://github.com/pycqa/isort + rev: dbf82f2dd09ae41d9355bcd7ab69187a19e6bf2f # frozen: 5.12.0 hooks: - - id: pylint + - id: isort diff --git a/setup.cfg b/setup.cfg index 761c8d6..adf523c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,5 +35,6 @@ install_requires = where = src [options.extras_require] -tests = flake8; pylint; tox +dev = isort; ruff docs = Sphinx >= 3.2; sphinx_rtd_theme >= 0.5.0 +tests = tox diff --git a/tox.ini b/tox.ini index 6170389..446e9f8 100644 --- a/tox.ini +++ b/tox.ini @@ -4,32 +4,35 @@ # and then run "tox" from this directory. [tox] -envlist = py37, py38, py39, py310, flake8, pylint -skip_missing_interpreters = true -minversion = 3.0 +minversion = 4.0 isolated_build = true +skip_missing_interpreters = true + +envlist = + py37 + py38 + py39 + py310 + format + lint [testenv] -description = "Faker Wi-Fi ESSID's unit tests" +description = "Run all tests" commands = - {envpython} -m unittest discover -s tests + {envpython} -m unittest discover -[testenv:flake8] -description = "Check Faker Wi-Fi ESSID's code style & quality" -deps = flake8 +[testenv:format] +description = "Run formatters" +skip_install = true +deps = + ruff commands = - {envpython} -m flake8 src tests + ruff format src tests -[testenv:pylint] -description = "Check Faker Wi-Fi ESSID for programming errors" -deps = pylint +[testenv:lint] +description = "Run linters" +skip_install = true +deps = + ruff commands = - {envpython} -m pylint src tests - -[gh-actions] -description = "tox configuration when running on GitHub Actions" -python = - 3.7: py37, flake8, pylint - 3.8: py38, flake8, pylint - 3.9: py39, flake8, pylint - 3.10: py310, flake8, pylint + ruff check src tests From 710aace1663ea4ecf2fa1b0e91f174ce63fbc743 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Tue, 16 May 2023 02:23:03 +0200 Subject: [PATCH 14/38] Fix formatting issues --- src/faker_wifi_essid/common_essids.py | 82 +++++++++++++-------------- src/faker_wifi_essid/wifi_essid.py | 12 ++-- tests/test_wifi_essid.py | 5 +- 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/src/faker_wifi_essid/common_essids.py b/src/faker_wifi_essid/common_essids.py index 3ccdd17..de698e7 100644 --- a/src/faker_wifi_essid/common_essids.py +++ b/src/faker_wifi_essid/common_essids.py @@ -6,45 +6,45 @@ # Based on https://wigle.net/stats#ssidstats. COMMON_ESSIDS = ( - '3Com', - 'Airport_Free_WiFi_AENA', - 'AndroidAP', - 'AndroidTether', - 'eduroam', - 'Exhibitor Internet', - 'FBI Surveillance Van', - 'freeBestBuywifi', - 'freebox', - 'Free Internet Access', - 'Free Public WiFi', - 'FRITZ!Box', - 'FRITZ!Box Fon WLAN', - 'FRITZ!Box Guest Access', - 'GetYourOwn', - 'get your own WiFi', - 'GuestAccess', - 'Guest Network', - 'GuestWiFi', - 'GuestWireless', - 'H&M Free WiFi', - 'Home Network', - 'Home Sweet Home', - 'Horizon Wi-Free', - 'KFC Free WiFi', - 'McDonalds Free WiFi', - 'MGMResorts-WiFi', - 'Moscow_WiFi_FREE', - 'NETGEAR-5G-GUEST', - 'Neuf WiFi', - 'Nordstrom_Wi-Fi', - 'Radisson_Guest', - 'Rostelecom', - 'SFR WiFi Public', - 'Starbucks WiFi', - 'Swisscom_Auto_Login', - 'visitors', - 'Vodafone Homespot', - 'Vodafone Hotspot', - 'Vodafone-Guest', - 'Welcome', + "3Com", + "Airport_Free_WiFi_AENA", + "AndroidAP", + "AndroidTether", + "eduroam", + "Exhibitor Internet", + "FBI Surveillance Van", + "freeBestBuywifi", + "freebox", + "Free Internet Access", + "Free Public WiFi", + "FRITZ!Box", + "FRITZ!Box Fon WLAN", + "FRITZ!Box Guest Access", + "GetYourOwn", + "get your own WiFi", + "GuestAccess", + "Guest Network", + "GuestWiFi", + "GuestWireless", + "H&M Free WiFi", + "Home Network", + "Home Sweet Home", + "Horizon Wi-Free", + "KFC Free WiFi", + "McDonalds Free WiFi", + "MGMResorts-WiFi", + "Moscow_WiFi_FREE", + "NETGEAR-5G-GUEST", + "Neuf WiFi", + "Nordstrom_Wi-Fi", + "Radisson_Guest", + "Rostelecom", + "SFR WiFi Public", + "Starbucks WiFi", + "Swisscom_Auto_Login", + "visitors", + "Vodafone Homespot", + "Vodafone Hotspot", + "Vodafone-Guest", + "Welcome", ) diff --git a/src/faker_wifi_essid/wifi_essid.py b/src/faker_wifi_essid/wifi_essid.py index 93226b3..b480f53 100644 --- a/src/faker_wifi_essid/wifi_essid.py +++ b/src/faker_wifi_essid/wifi_essid.py @@ -16,8 +16,8 @@ class WifiESSID(BaseProvider): def common_essid(self): """ - Returns a random ESSID from a list of the most - commonly used ones. + Returns a random ESSID from a list of the most commonly used ones. + See https://wigle.net/stats#ssidstats. """ @@ -25,8 +25,8 @@ def common_essid(self): def upc_default_essid(self): """ - Generates a random ESSID similar to the default ones - used by UPC. + Generates a random ESSID similar to the default ones used by UPC. + https://deadcode.me/blog/2016/07/01/UPC-UBEE-EVW3226-WPA2-Reversing.html. """ @@ -34,8 +34,8 @@ def upc_default_essid(self): def bbox_default_essid(self): """ - Generates a random ESSID similar to the default ones - used by Bouygues Telecom's Bbox. + Generates a random ESSID similar to the default ones used by Bouygues + Telecom's Bbox. """ return self.hexify("Bbox-^^^^^^", upper=True) diff --git a/tests/test_wifi_essid.py b/tests/test_wifi_essid.py index 6be65dd..b18e262 100644 --- a/tests/test_wifi_essid.py +++ b/tests/test_wifi_essid.py @@ -10,6 +10,7 @@ import unittest from faker import Faker + from faker_wifi_essid import WifiESSID from faker_wifi_essid.common_essids import COMMON_ESSIDS @@ -25,8 +26,8 @@ def setUp(self): def test_if_string(self): """ - Tests if the values returned by the fake Wi-Fi ESSID - generators are strings. + Tests if the values returned by the fake Wi-Fi ESSID generators are + strings. """ for _ in range(10): From 8e7b1a33aa607d725a2476d3f41970d23d554f7e Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 27 Nov 2024 14:14:24 +0100 Subject: [PATCH 15/38] Replace 'setup.cfg' with 'pyproject.toml' This commit implements PEP 621 by specifying all project metadata in the 'pyproject.toml' file. See https://peps.python.org/pep-0621/. --- pyproject.toml | 44 ++++++++++++++++++++++++++++++-- setup.cfg | 40 ----------------------------- src/faker_wifi_essid/__init__.py | 4 +-- 3 files changed, 43 insertions(+), 45 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 4602018..3cf6f6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,47 @@ [build-system] requires = [ - "setuptools >= 42", - "setuptools_scm >= 2.0.0, <3", + "setuptools >= 61", "wheel", ] build-backend = "setuptools.build_meta" + +[project] +name = "faker_wifi_essid" +authors = [ + {name = "Paul-Emmanuel Raoul", email = "skyper@skyplabs.net"}, +] +description = "Faker provider for Wi-Fi ESSIDs." +readme = "README.rst" +keywords = ["faker", "faker-library", "faker-provider", "faker-generator", "wifi", "essid"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries :: Python Modules", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "License :: OSI Approved :: MIT License", +] +requires-python = ">=3.7, <4" +dependencies = [ + "Faker >= 4.1,< 20.0", +] +dynamic = ["version"] + +[project.urls] +"Bug Tracker" = "https://github.com/SkypLabs/faker-wifi-essid/issues" +Repository = "https://github.com/SkypLabs/faker-wifi-essid" + +[project.optional-dependencies] +dev = ["isort", "ruff"] +docs = ["Sphinx >= 3.2", "sphinx_rtd_theme >= 0.5.0"] +tests = ["tox"] + +[tool.setuptools.dynamic] +version = {attr = "faker_wifi_essid.__version__"} + +[tool.setuptools.packages.find] +where = ["src"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index adf523c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,40 +0,0 @@ -[metadata] -name = faker_wifi_essid -version = 0.4.1 -description = Faker provider for Wi-Fi ESSIDs. -long_description = file: README.rst -keywords = faker, faker-library, faker-provider, faker-generator, wifi, essid -license = MIT -license_files = LICENSE -author = Paul-Emmanuel Raoul -author_email = skyper@skyplabs.net -url = https://github.com/SkypLabs/faker-wifi-essid -project_urls = - Bug Tracker = https://github.com/SkypLabs/faker-wifi-essid/issues -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Developers - Topic :: Software Development :: Libraries :: Python Modules - Operating System :: OS Independent - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - License :: OSI Approved :: MIT License - -[options] -packages = find: -package_dir = - =src -python_requires = >=3.7, <4 -install_requires = - Faker >= 4.1,< 20.0 - -[options.packages.find] -where = src - -[options.extras_require] -dev = isort; ruff -docs = Sphinx >= 3.2; sphinx_rtd_theme >= 0.5.0 -tests = tox diff --git a/src/faker_wifi_essid/__init__.py b/src/faker_wifi_essid/__init__.py index 0ae24eb..437a50c 100644 --- a/src/faker_wifi_essid/__init__.py +++ b/src/faker_wifi_essid/__init__.py @@ -4,11 +4,9 @@ Faker Wi-Fi ESSID provider. """ -from pkg_resources import get_distribution - from .wifi_essid import WifiESSID -__version__ = get_distribution("faker_wifi_essid").version +__version__ = "0.4.1" __all__ = [ "WifiESSID", From 6965c93fb7a8f4720b5a1cca9db287ad03ed7d35 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 27 Nov 2024 22:33:25 +0100 Subject: [PATCH 16/38] Drop support for Python 3.7 and 3.8 Python 3.7 reached end-of-life on 27/06/2023, and Python 3.8 on 07/10/2024. See https://devguide.python.org/versions/. --- .github/workflows/test_and_publish.yml | 6 ++---- pyproject.toml | 4 +--- tox.ini | 2 -- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index dcd38d4..8873745 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -12,11 +12,9 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] python-version: - - '3.7' - - '3.8' - '3.9' - '3.10' - - 'pypy-3.8' + - 'pypy-3.9' steps: - name: Check out code @@ -39,7 +37,7 @@ jobs: name: Test documentation runs-on: ubuntu-latest env: - PYTHON_VERSION: 3.8 + PYTHON_VERSION: '3.x' steps: - name: Check out code uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 3cf6f6c..33aa291 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,13 +19,11 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "License :: OSI Approved :: MIT License", ] -requires-python = ">=3.7, <4" +requires-python = ">=3.9, <4" dependencies = [ "Faker >= 4.1,< 20.0", ] diff --git a/tox.ini b/tox.ini index 446e9f8..5120320 100644 --- a/tox.ini +++ b/tox.ini @@ -9,8 +9,6 @@ isolated_build = true skip_missing_interpreters = true envlist = - py37 - py38 py39 py310 format From 4d9f1e23d58243a49d73aab912aec49f90590e0c Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 27 Nov 2024 22:42:45 +0100 Subject: [PATCH 17/38] Fix Sphinx configuration with Python 3.12 Python 3.12 has removed 'pkg_resources' from the standard library: https://docs.python.org/3/whatsnew/3.12.html. --- docs/conf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 27956a4..4f2ebbd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,8 +16,7 @@ # pylint: skip-file -from pkg_resources import get_distribution - +from faker_wifi_essid import __version__ as VERSION # -- Project information ----------------------------------------------------- @@ -26,7 +25,7 @@ author = 'Paul-Emmanuel Raoul' # The full version, including alpha/beta/rc tags -release = get_distribution("faker_wifi_essid").version +release = VERSION # -- General configuration --------------------------------------------------- From 46443977c2ed7a93b46ec0ee6fc74081d48b0982 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 27 Nov 2024 22:56:37 +0100 Subject: [PATCH 18/38] Add support for Python 3.11, 3.12 and 3.13 --- .github/workflows/test_and_publish.yml | 3 +++ pyproject.toml | 3 +++ tox.ini | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index 8873745..6a2f331 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -14,6 +14,9 @@ jobs: python-version: - '3.9' - '3.10' + - '3.11' + - '3.12' + - '3.13' - 'pypy-3.9' steps: diff --git a/pyproject.toml b/pyproject.toml index 33aa291..a383889 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,9 @@ classifiers = [ "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "License :: OSI Approved :: MIT License", ] requires-python = ">=3.9, <4" diff --git a/tox.ini b/tox.ini index 5120320..8b1571e 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,9 @@ skip_missing_interpreters = true envlist = py39 py310 + py311 + py312 + py313 format lint From 9c62efc7236f31b07dde17934e7db11829773ac5 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 27 Nov 2024 23:13:27 +0100 Subject: [PATCH 19/38] Replace isort with Ruff --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a383889..bfb5ac4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dynamic = ["version"] Repository = "https://github.com/SkypLabs/faker-wifi-essid" [project.optional-dependencies] -dev = ["isort", "ruff"] +dev = ["ruff"] docs = ["Sphinx >= 3.2", "sphinx_rtd_theme >= 0.5.0"] tests = ["tox"] @@ -46,3 +46,7 @@ version = {attr = "faker_wifi_essid.__version__"} [tool.setuptools.packages.find] where = ["src"] + +[tool.ruff.lint] +# Enable the isort rules. +extend-select = ["I"] From c9d1d59040dff600916c76eee6dd3c0c516f6152 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 27 Nov 2024 23:41:01 +0100 Subject: [PATCH 20/38] Remove isort pre-commit hook --- .pre-commit-config.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9dbc275..5403a00 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,8 +10,3 @@ repos: rev: e812d61e6e9d269f44ecda63904ed670a1948fe8 # frozen: v0.0.257 hooks: - id: ruff - - - repo: https://github.com/pycqa/isort - rev: dbf82f2dd09ae41d9355bcd7ab69187a19e6bf2f # frozen: 5.12.0 - hooks: - - id: isort From 0a1b6bf2bc4bdcd4a9da39b718bfff3d391c739b Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 27 Nov 2024 23:49:15 +0100 Subject: [PATCH 21/38] Update pre-commit hooks --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5403a00..9244580 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: f71fa2c1f9cf5cb705f73dffe4b21f7c61470ba9 # frozen: v4.4.0 + rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0 hooks: - id: check-ast - id: check-yaml - id: trailing-whitespace - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: e812d61e6e9d269f44ecda63904ed670a1948fe8 # frozen: v0.0.257 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: 0710b94280408eef12748cde4782972942370ad2 # frozen: v0.8.0 hooks: - id: ruff From acf6f7a01db7dd5d3b43185875b91595a69dd2a6 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 27 Nov 2024 23:53:46 +0100 Subject: [PATCH 22/38] Add 'ruff-format' pre-commit hook --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9244580..b82bace 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,3 +10,4 @@ repos: rev: 0710b94280408eef12748cde4782972942370ad2 # frozen: v0.8.0 hooks: - id: ruff + - id: ruff-format From 3927b940521206dd42414908f3263847f408e9db Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Wed, 27 Nov 2024 23:54:50 +0100 Subject: [PATCH 23/38] Add '--fix' argument to 'ruff' pre-commit hook --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b82bace..becbd49 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,4 +10,5 @@ repos: rev: 0710b94280408eef12748cde4782972942370ad2 # frozen: v0.8.0 hooks: - id: ruff + args: [ --fix ] - id: ruff-format From 9a4a6dffb989973ba04499201a3b0b40b429d387 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Thu, 28 Nov 2024 00:01:41 +0100 Subject: [PATCH 24/38] Run Ruff linter and formatter on all files --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 8b1571e..ff54358 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,7 @@ skip_install = true deps = ruff commands = - ruff format src tests + ruff format [testenv:lint] description = "Run linters" @@ -36,4 +36,4 @@ skip_install = true deps = ruff commands = - ruff check src tests + ruff check From 771bf2d1642d83ec493b3849deb926967f37d5eb Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Thu, 28 Nov 2024 00:02:41 +0100 Subject: [PATCH 25/38] Fix formatting issues --- docs/conf.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4f2ebbd..638be4e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,9 +20,9 @@ # -- Project information ----------------------------------------------------- -project = 'Faker Wi-Fi ESSID' -copyright = '2022, Paul-Emmanuel Raoul' -author = 'Paul-Emmanuel Raoul' +project = "Faker Wi-Fi ESSID" +copyright = "2022, Paul-Emmanuel Raoul" +author = "Paul-Emmanuel Raoul" # The full version, including alpha/beta/rc tags release = VERSION @@ -34,19 +34,19 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', + "sphinx.ext.autodoc", ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The master toctree document. -master_doc = 'index' +master_doc = "index" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # -- Options for HTML output ------------------------------------------------- @@ -54,19 +54,19 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # -- Options for GitHub integration ------------------------------------------- html_context = { - 'display_github': True, # Integrate GitHub - 'github_user': 'SkypLabs', # Username - 'github_repo': 'faker-wifi-essid', # Repo name - 'github_version': 'develop', # Version - 'conf_py_path': '/docs/', # Path in the checkout to the docs root + "display_github": True, # Integrate GitHub + "github_user": "SkypLabs", # Username + "github_repo": "faker-wifi-essid", # Repo name + "github_version": "develop", # Version + "conf_py_path": "/docs/", # Path in the checkout to the docs root } From 404915b4a05eaed19a7550849649b3fc7bd4aa28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:43:59 +0000 Subject: [PATCH 26/38] Update faker requirement from <20.0,>=4.1 to >=4.1,<34.0 Updates the requirements on [faker](https://github.com/joke2k/faker) to permit the latest version. - [Release notes](https://github.com/joke2k/faker/releases) - [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md) - [Commits](https://github.com/joke2k/faker/compare/v4.1.0...v33.1.0) --- updated-dependencies: - dependency-name: faker dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bfb5ac4..7f6d627 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ ] requires-python = ">=3.9, <4" dependencies = [ - "Faker >= 4.1,< 20.0", + "Faker >= 4.1,< 34.0", ] dynamic = ["version"] From f1d3cd4153992171c1800da55df7d909cf7035cb Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 13 Dec 2024 12:17:22 +0100 Subject: [PATCH 27/38] Add type hints See https://docs.python.org/3/library/typing.html. --- src/faker_wifi_essid/wifi_essid.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/faker_wifi_essid/wifi_essid.py b/src/faker_wifi_essid/wifi_essid.py index b480f53..3b136c6 100644 --- a/src/faker_wifi_essid/wifi_essid.py +++ b/src/faker_wifi_essid/wifi_essid.py @@ -4,6 +4,8 @@ A Faker provider for Wi-Fi ESSIDs. """ +from collections.abc import Callable + from faker.providers import BaseProvider from .common_essids import COMMON_ESSIDS @@ -14,7 +16,7 @@ class WifiESSID(BaseProvider): A Faker provider for Wi-Fi ESSIDs. """ - def common_essid(self): + def common_essid(self) -> str: """ Returns a random ESSID from a list of the most commonly used ones. @@ -23,7 +25,7 @@ def common_essid(self): return self.random_element(COMMON_ESSIDS) - def upc_default_essid(self): + def upc_default_essid(self) -> str: """ Generates a random ESSID similar to the default ones used by UPC. @@ -32,7 +34,7 @@ def upc_default_essid(self): return "UPC" + str(self.random_number(7, True)) - def bbox_default_essid(self): + def bbox_default_essid(self) -> str: """ Generates a random ESSID similar to the default ones used by Bouygues Telecom's Bbox. @@ -41,13 +43,13 @@ def bbox_default_essid(self): return self.hexify("Bbox-^^^^^^", upper=True) # List of the different ESSID generators. - essid_generators = [ + essid_generators: list[Callable] = [ bbox_default_essid, common_essid, upc_default_essid, ] - def wifi_essid(self): + def wifi_essid(self) -> str: """ Returns a random fake Wi-Fi essid. """ From 26848a550cb83071ceaf7cc9d9d41acc8b2236a1 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 13 Dec 2024 15:06:38 +0100 Subject: [PATCH 28/38] Turn 'essid_generators' into a private attribute The 'essid_generators' attribute is not meant to be used outside the 'WifiESSID' class. As a result, this commit turns it into a private attribute. See https://docs.python.org/3/tutorial/classes.html#private-variables. --- src/faker_wifi_essid/wifi_essid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/faker_wifi_essid/wifi_essid.py b/src/faker_wifi_essid/wifi_essid.py index 3b136c6..ca280ee 100644 --- a/src/faker_wifi_essid/wifi_essid.py +++ b/src/faker_wifi_essid/wifi_essid.py @@ -43,7 +43,7 @@ def bbox_default_essid(self) -> str: return self.hexify("Bbox-^^^^^^", upper=True) # List of the different ESSID generators. - essid_generators: list[Callable] = [ + _essid_generators: list[Callable] = [ bbox_default_essid, common_essid, upc_default_essid, @@ -54,4 +54,4 @@ def wifi_essid(self) -> str: Returns a random fake Wi-Fi essid. """ - return self.random_element(self.essid_generators)(self) + return self.random_element(self._essid_generators)(self) From af18fcfe2228b1da300f1fe235e381faa0c24f1d Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 13 Dec 2024 15:20:01 +0100 Subject: [PATCH 29/38] Add type hints to tests --- tests/test_wifi_essid.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_wifi_essid.py b/tests/test_wifi_essid.py index b18e262..c9cca8a 100644 --- a/tests/test_wifi_essid.py +++ b/tests/test_wifi_essid.py @@ -20,11 +20,11 @@ class TestWifiESSID(unittest.TestCase): Unit tests for the 'WifiESSID' class. """ - def setUp(self): + def setUp(self) -> None: self.fake = Faker() self.fake.add_provider(WifiESSID) - def test_if_string(self): + def test_if_string(self) -> None: """ Tests if the values returned by the fake Wi-Fi ESSID generators are strings. @@ -36,7 +36,7 @@ def test_if_string(self): self.assertTrue(isinstance(self.fake.bbox_default_essid(), str)) self.assertTrue(isinstance(self.fake.wifi_essid(), str)) - def test_common_essid(self): + def test_common_essid(self) -> None: """ Tests if the 'common_essid()' method returns values from 'COMMON_ESSIDS' as expected. @@ -45,7 +45,7 @@ def test_common_essid(self): for _ in range(10): self.assertIn(self.fake.common_essid(), COMMON_ESSIDS) - def test_upc_default_essid(self): + def test_upc_default_essid(self) -> None: """ Tests if the values returned by the 'upc_default_essid()' method match the UPC ESSIDs' regex. @@ -56,7 +56,7 @@ def test_upc_default_essid(self): for _ in range(10): self.assertTrue(re.match(regex, self.fake.upc_default_essid())) - def test_bbox_default_essid(self): + def test_bbox_default_essid(self) -> None: """ Tests if the values returned by the 'bbox_default_essid()' method match the Bbox ESSIDs' regex. From bf2b6944f07c6c4346ef9a9a51c0d77f7c07a4f7 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Thu, 20 Jun 2024 13:43:14 +0200 Subject: [PATCH 30/38] Add 'Development' section to documentation --- docs/development.rst | 31 +++++++++++++++++++++++++++++++ docs/index.rst | 1 + 2 files changed, 32 insertions(+) create mode 100644 docs/development.rst diff --git a/docs/development.rst b/docs/development.rst new file mode 100644 index 0000000..405fb94 --- /dev/null +++ b/docs/development.rst @@ -0,0 +1,31 @@ +=========== +Development +=========== + +Dropping support for deprecated Python versions +----------------------------------------------- + +When a Python version is officially deprecated, it needs to be removed from the +versions supported by this package. To do so, the following actions need to be taken: + +* In `setup.cfg`: + + * Remove the Python version from the classifiers. + * Update the minimum supported Python version in `python_requires`. + +* In `tox.ini`: + + * Remove the Python version from `tox.envlist`. + * Remove the Python version from `gh-actions.python`. + +* In `.github/workflows/test_and_publish.yml`: + + * Remove the Python version from the build matrix. + +* In the GitHub repository settings: + + * If necessary, update the required status checks in the branch protection + rules. + +The status of the Python versions can be found `here +`_. diff --git a/docs/index.rst b/docs/index.rst index a1a597f..1d2f9c2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,6 +18,7 @@ Faker Wi-Fi ESSID is a `Faker`_ provider for Wi-Fi ESSIDs. installation usage modules + development documentation .. _Faker: https://github.com/joke2k/faker/ From 8ffe4bbf215a4625d15545e7a5898bace5547c86 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 13 Dec 2024 15:51:12 +0100 Subject: [PATCH 31/38] Use dynamic copyright range in Sphinx doc --- docs/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 638be4e..e2884e4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,12 +16,14 @@ # pylint: skip-file +from datetime import datetime + from faker_wifi_essid import __version__ as VERSION # -- Project information ----------------------------------------------------- project = "Faker Wi-Fi ESSID" -copyright = "2022, Paul-Emmanuel Raoul" +copyright = f"2018-{datetime.now().year}, Paul-Emmanuel Raoul" author = "Paul-Emmanuel Raoul" # The full version, including alpha/beta/rc tags From 318f01f2b3e054c268652e0c4c304f28292df033 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 13 Dec 2024 15:56:25 +0100 Subject: [PATCH 32/38] Update instructions related to 'setup.cfg' This commit updates all references to 'setup.cfg' following its replacement with 'pyproject.toml' in commit 8e7b1a3. --- docs/development.rst | 5 ++--- docs/documentation.rst | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/development.rst b/docs/development.rst index 405fb94..581ba74 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -8,15 +8,14 @@ Dropping support for deprecated Python versions When a Python version is officially deprecated, it needs to be removed from the versions supported by this package. To do so, the following actions need to be taken: -* In `setup.cfg`: +* In `pyproject.toml`: * Remove the Python version from the classifiers. - * Update the minimum supported Python version in `python_requires`. + * Update the minimum supported Python version in `requires-python`. * In `tox.ini`: * Remove the Python version from `tox.envlist`. - * Remove the Python version from `gh-actions.python`. * In `.github/workflows/test_and_publish.yml`: diff --git a/docs/documentation.rst b/docs/documentation.rst index 4214ccd..14e59f2 100644 --- a/docs/documentation.rst +++ b/docs/documentation.rst @@ -8,8 +8,8 @@ folder. Install the dependencies ------------------------ -The dependencies required to build the documentation are defined in `setup.py` -as an optional dependency group called `docs`. +The dependencies required to build the documentation are defined in +`pyproject.toml` as an optional dependency group called `docs`. To install the dependencies in `docs`: From 82c1c95bc56c02a8fbb99b0ddad8646cb4bd2ea3 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 13 Dec 2024 16:17:38 +0100 Subject: [PATCH 33/38] Reorganise documentation pages --- docs/development.rst | 29 +++---------------- docs/{ => development}/documentation.rst | 0 .../drop-deprecated-py-versions.rst | 28 ++++++++++++++++++ docs/{ => development}/modules.rst | 2 +- .../modules/faker_wifi_essid.rst | 0 docs/index.rst | 3 +- 6 files changed, 34 insertions(+), 28 deletions(-) rename docs/{ => development}/documentation.rst (100%) create mode 100644 docs/development/drop-deprecated-py-versions.rst rename docs/{ => development}/modules.rst (100%) rename docs/{ => development}/modules/faker_wifi_essid.rst (100%) diff --git a/docs/development.rst b/docs/development.rst index 581ba74..deb0505 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -2,29 +2,8 @@ Development =========== -Dropping support for deprecated Python versions ------------------------------------------------ +.. toctree:: + :glob: + :maxdepth: 2 -When a Python version is officially deprecated, it needs to be removed from the -versions supported by this package. To do so, the following actions need to be taken: - -* In `pyproject.toml`: - - * Remove the Python version from the classifiers. - * Update the minimum supported Python version in `requires-python`. - -* In `tox.ini`: - - * Remove the Python version from `tox.envlist`. - -* In `.github/workflows/test_and_publish.yml`: - - * Remove the Python version from the build matrix. - -* In the GitHub repository settings: - - * If necessary, update the required status checks in the branch protection - rules. - -The status of the Python versions can be found `here -`_. + development/* diff --git a/docs/documentation.rst b/docs/development/documentation.rst similarity index 100% rename from docs/documentation.rst rename to docs/development/documentation.rst diff --git a/docs/development/drop-deprecated-py-versions.rst b/docs/development/drop-deprecated-py-versions.rst new file mode 100644 index 0000000..dce6934 --- /dev/null +++ b/docs/development/drop-deprecated-py-versions.rst @@ -0,0 +1,28 @@ +=============================================== +Dropping support for deprecated Python versions +=============================================== + +When a Python version is officially deprecated, it needs to be removed from the +versions supported by this package. To do so, the following actions need to be taken: + +* In `pyproject.toml`: + + * Remove the Python version from the classifiers. + * Update the minimum supported Python version in `requires-python`. + +* In `tox.ini`: + + * Remove the Python version from `tox.envlist`. + +* In `.github/workflows/test_and_publish.yml`: + + * Remove the Python version from the build matrix. + +* In the GitHub repository settings: + + * If necessary, update the required status checks in the branch protection + rules. + +The status of the Python versions can be found `here +`_. + diff --git a/docs/modules.rst b/docs/development/modules.rst similarity index 100% rename from docs/modules.rst rename to docs/development/modules.rst index 5cdee9b..5acb920 100644 --- a/docs/modules.rst +++ b/docs/development/modules.rst @@ -5,7 +5,7 @@ Modules The different modules of Faker Wi-Fi ESSID will be listed here. .. toctree:: - :maxdepth: 1 :glob: + :maxdepth: 1 modules/* diff --git a/docs/modules/faker_wifi_essid.rst b/docs/development/modules/faker_wifi_essid.rst similarity index 100% rename from docs/modules/faker_wifi_essid.rst rename to docs/development/modules/faker_wifi_essid.rst diff --git a/docs/index.rst b/docs/index.rst index 1d2f9c2..efdb788 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,11 +14,10 @@ Faker Wi-Fi ESSID is a `Faker`_ provider for Wi-Fi ESSIDs. .. toctree:: :caption: Contents + :maxdepth: 2 installation usage - modules development - documentation .. _Faker: https://github.com/joke2k/faker/ From ee9057e74c8129c8a364fb8fc6bb354667734545 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 13 Dec 2024 17:09:56 +0100 Subject: [PATCH 34/38] Update installation instructions --- docs/development/documentation.rst | 2 +- docs/installation.rst | 25 ++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/development/documentation.rst b/docs/development/documentation.rst index 14e59f2..6606f3c 100644 --- a/docs/development/documentation.rst +++ b/docs/development/documentation.rst @@ -15,7 +15,7 @@ To install the dependencies in `docs`: :: - pip3 install .[docs] + pip install .[docs] Build the documentation diff --git a/docs/installation.rst b/docs/installation.rst index 96f20a9..cbc5782 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -5,9 +5,22 @@ Installation From PyPI (recommended) ----------------------- -:: +To install Faker Wi-Fi ESSID from `PyPI`_ with pip: - pip3 install --upgrade faker-wifi-essid +.. code:: sh + + pip install --upgrade faker-wifi-essid + +However, as Faker Wi-Fi ESSID is a programming library (a `module `_ in Python parlance), it is most likely to be added as a dependency +to the `pyproject.toml` file of your project or its equivalent configuration +file: + +.. code:: toml + + dependencies = [ + "faker_wifi_essid", + ] From sources ------------ @@ -17,10 +30,12 @@ Faker Wi-Fi ESSID is packaged with `Setuptools`_. The default Git branch is `develop`. To install the latest stable version, you need to clone the `main` branch. -:: +.. code:: sh - git clone -b main git@github.com:SkypLabs/faker-wifi-essid.git + git clone -b main https://github.com/SkypLabs/faker-wifi-essid.git cd faker-wifi-essid - pip3 install . + pip install . +.. _Python Modules: https://docs.python.org/3/tutorial/modules.html +.. _PyPI: https://pypi.org/ .. _Setuptools: https://pypi.org/project/setuptools/ From de7e0f9177990174f3e939533b0276c0938247a5 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 14 Dec 2024 11:37:58 +0100 Subject: [PATCH 35/38] Update gitignore --- .gitignore | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0c93ead..1867c94 100644 --- a/.gitignore +++ b/.gitignore @@ -61,5 +61,10 @@ target/ # Output files *.csv -# Others -*.swp +# Text editors +*~ +*.sw[nop] + +# Virtual environments +venv/ +.venv/ From 6f78bcd59e993280db8ae5ed733b6a9670546086 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 14 Dec 2024 11:32:07 +0100 Subject: [PATCH 36/38] Update copyright year range --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2bf27bf..67c9834 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018-2022 Paul-Emmanuel Raoul +Copyright (c) 2018-2024 Paul-Emmanuel Raoul Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From bdc3f56c6b63f1824f32872dbdcfaf6a192ca016 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 14 Dec 2024 11:36:39 +0100 Subject: [PATCH 37/38] Update readme --- README.rst | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index 06d8abf..b1d965e 100644 --- a/README.rst +++ b/README.rst @@ -2,8 +2,7 @@ Faker Wi-Fi ESSID ================= -|PyPI Package| |PyPI Downloads| |PyPI Python Versions| |Build Status| |LGTM -Grade| |LGTM Alerts| +|PyPI Package| |PyPI Downloads| |PyPI Python Versions| |Build Status| `Faker `__ provider for Wi-Fi ESSIDs. @@ -32,20 +31,12 @@ Usage License ======= -`MIT `__ +This project is `MIT `__ licensed. .. |Build Status| image:: https://github.com/SkypLabs/faker-wifi-essid/actions/workflows/test_and_publish.yml/badge.svg?branch=develop :target: https://github.com/SkypLabs/faker-wifi-essid/actions/workflows/test_and_publish.yml?query=branch%3Adevelop :alt: Build Status -.. |LGTM Alerts| image:: https://img.shields.io/lgtm/alerts/g/SkypLabs/faker-wifi-essid.svg?logo=lgtm&logoWidth=18 - :target: https://lgtm.com/projects/g/SkypLabs/fake-wifi-essid/alerts/ - :alt: LGTM Alerts - -.. |LGTM Grade| image:: https://img.shields.io/lgtm/grade/python/g/SkypLabs/faker-wifi-essid.svg?logo=lgtm&logoWidth=18 - :target: https://lgtm.com/projects/g/SkypLabs/faker-wifi-essid/context:python - :alt: LGTM Grade - .. |PyPI Downloads| image:: https://img.shields.io/pypi/dm/faker-wifi-essid.svg?style=flat :target: https://pypi.org/project/faker-wifi-essid/ :alt: PyPI Package Downloads Per Month From cee951f4aec3761538996d8c84940dd7aef29f52 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 14 Dec 2024 12:46:37 +0100 Subject: [PATCH 38/38] Bump version number to 0.5.0 --- src/faker_wifi_essid/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faker_wifi_essid/__init__.py b/src/faker_wifi_essid/__init__.py index 437a50c..2613572 100644 --- a/src/faker_wifi_essid/__init__.py +++ b/src/faker_wifi_essid/__init__.py @@ -6,7 +6,7 @@ from .wifi_essid import WifiESSID -__version__ = "0.4.1" +__version__ = "0.5.0" __all__ = [ "WifiESSID",