diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..1f16b95 --- /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@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index 330a0b5..6a2f331 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -10,20 +10,21 @@ 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' - '3.9' - '3.10' - - 'pypy-3.8' + - '3.11' + - '3.12' + - '3.13' + - 'pypy-3.9' steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -37,15 +38,15 @@ jobs: test-docs: name: Test documentation - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: - PYTHON_VERSION: 3.8 + PYTHON_VERSION: '3.x' steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -61,7 +62,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 @@ -69,10 +70,10 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.x' @@ -92,16 +93,16 @@ 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 steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.x' 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/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af21586..becbd49 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,14 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 8fe62d14e0b4d7d845a7022c5c2c3ae41bdd3f26 # frozen: v4.1.0 + rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.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/astral-sh/ruff-pre-commit + rev: 0710b94280408eef12748cde4782972942370ad2 # frozen: v0.8.0 hooks: - - id: flake8 - - - repo: https://github.com/pycqa/pylint - rev: eec287fae66f8fc514d5daa9caee46fd0e0cb6d9 # frozen: v2.12.2 - hooks: - - id: pylint + - id: ruff + args: [ --fix ] + - id: ruff-format 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 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 diff --git a/docs/conf.py b/docs/conf.py index 27956a4..e2884e4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,17 +16,18 @@ # pylint: skip-file -from pkg_resources import get_distribution +from datetime import datetime +from faker_wifi_essid import __version__ as VERSION # -- Project information ----------------------------------------------------- -project = 'Faker Wi-Fi ESSID' -copyright = '2022, Paul-Emmanuel Raoul' -author = 'Paul-Emmanuel Raoul' +project = "Faker Wi-Fi ESSID" +copyright = f"2018-{datetime.now().year}, Paul-Emmanuel Raoul" +author = "Paul-Emmanuel Raoul" # The full version, including alpha/beta/rc tags -release = get_distribution("faker_wifi_essid").version +release = VERSION # -- General configuration --------------------------------------------------- @@ -35,19 +36,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 ------------------------------------------------- @@ -55,19 +56,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 } diff --git a/docs/development.rst b/docs/development.rst new file mode 100644 index 0000000..deb0505 --- /dev/null +++ b/docs/development.rst @@ -0,0 +1,9 @@ +=========== +Development +=========== + +.. toctree:: + :glob: + :maxdepth: 2 + + development/* diff --git a/docs/documentation.rst b/docs/development/documentation.rst similarity index 88% rename from docs/documentation.rst rename to docs/development/documentation.rst index 4214ccd..6606f3c 100644 --- a/docs/documentation.rst +++ b/docs/development/documentation.rst @@ -8,14 +8,14 @@ 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`: :: - pip3 install .[docs] + pip install .[docs] Build the documentation 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 a1a597f..efdb788 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,10 +14,10 @@ Faker Wi-Fi ESSID is a `Faker`_ provider for Wi-Fi ESSIDs. .. toctree:: :caption: Contents + :maxdepth: 2 installation usage - modules - documentation + development .. _Faker: https://github.com/joke2k/faker/ 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/ diff --git a/pyproject.toml b/pyproject.toml index 4602018..7f6d627 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,52 @@ [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.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" +dependencies = [ + "Faker >= 4.1,< 34.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 = ["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"] + +[tool.ruff.lint] +# Enable the isort rules. +extend-select = ["I"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9c558e3..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -. diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ebf11e6..0000000 --- a/setup.cfg +++ /dev/null @@ -1,39 +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,< 14.0 - -[options.packages.find] -where = src - -[options.extras_require] -tests = flake8; pylint; tox -docs = Sphinx >= 3.2; sphinx_rtd_theme >= 0.5.0 diff --git a/src/faker_wifi_essid/__init__.py b/src/faker_wifi_essid/__init__.py index 0ae24eb..2613572 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.5.0" __all__ = [ "WifiESSID", 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..ca280ee 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,42 +16,42 @@ 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. + Returns a random ESSID from a list of the most commonly used ones. + See https://wigle.net/stats#ssidstats. """ 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. + 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. """ 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. + Generates a random ESSID similar to the default ones used by Bouygues + Telecom's Bbox. """ 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. """ - return self.random_element(self.essid_generators)(self) + return self.random_element(self._essid_generators)(self) diff --git a/tests/test_wifi_essid.py b/tests/test_wifi_essid.py index 83b5b23..c9cca8a 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 @@ -19,14 +20,14 @@ 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. + Tests if the values returned by the fake Wi-Fi ESSID generators are + strings. """ for _ in range(10): @@ -35,16 +36,16 @@ 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. """ 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): + def test_upc_default_essid(self) -> None: """ Tests if the values returned by the 'upc_default_essid()' method match the UPC ESSIDs' regex. @@ -55,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. diff --git a/tox.ini b/tox.ini index 6170389..ff54358 100644 --- a/tox.ini +++ b/tox.ini @@ -4,32 +4,36 @@ # 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 = + py39 + py310 + py311 + py312 + py313 + 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 -[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