diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 0538874..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -github: SkypLabs -ko_fi: skyplabs -custom: ["https://blog.skyplabs.net/support/", "https://www.buymeacoffee.com/skyplabs", "https://paypal.me/skyplabs"] diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 39247da..4ec4496 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,15 +1,20 @@ version: 2 updates: -- package-ecosystem: pip - directory: "/" - schedule: - interval: daily - time: "09:00" - timezone: Europe/Dublin - open-pull-requests-limit: 10 - target-branch: develop - ignore: - - dependency-name: faker - versions: - - 5.0.0 - - 7.0.1 + + - package-ecosystem: pip + directory: "/" + schedule: + interval: weekly + time: "09:00" + timezone: Europe/Dublin + open-pull-requests-limit: 10 + target-branch: develop + + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + time: "09:00" + timezone: Europe/Dublin + open-pull-requests-limit: 10 + target-branch: develop diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index 9837cc1..dcac979 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -11,14 +11,19 @@ jobs: strategy: matrix: os: [ubuntu-20.04, macos-10.15] - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - 'pypy-3.8' steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} @@ -37,10 +42,10 @@ jobs: PYTHON_VERSION: 3.8 steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ env.PYTHON_VERSION }} @@ -57,17 +62,17 @@ jobs: name: Publish to TestPyPI environment: staging runs-on: ubuntu-20.04 - if: github.ref == 'refs/heads/master' && github.event_name == 'push' + if: github.ref == 'refs/heads/main' && github.event_name == 'push' needs: - test-code - test-docs steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.x' @@ -88,15 +93,15 @@ jobs: name: Publish to PyPI environment: production runs-on: ubuntu-20.04 - if: github.ref == 'refs/heads/master' && github.event_name == 'push' + if: github.ref == 'refs/heads/main' && github.event_name == 'push' needs: publish-to-test-pypi steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.x' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d5165dd..af21586 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,18 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 0b70e285e369bcb24b57b74929490ea7be9c4b19 # v2.2.3 + rev: 8fe62d14e0b4d7d845a7022c5c2c3ae41bdd3f26 # frozen: v4.1.0 hooks: - id: check-ast - id: check-executables-have-shebangs - id: check-yaml - - id: flake8 - id: trailing-whitespace - - repo: https://github.com/pre-commit/mirrors-pylint - rev: 59c5533087e77a99a5697b1faac86615f3ce4a10 # frozen: v3.0.0a4 + + - repo: https://github.com/pycqa/flake8 + rev: cbeb4c9c4137cff1568659fcc48e8b85cddd0c8d # frozen: 4.0.1 + hooks: + - id: flake8 + + - repo: https://github.com/pycqa/pylint + rev: eec287fae66f8fc514d5daa9caee46fd0e0cb6d9 # frozen: v2.12.2 hooks: - id: pylint - entry: python3 -m pylint.__main__ - language: system diff --git a/LICENSE b/LICENSE index 53f0eec..2bf27bf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018-2021 Paul-Emmanuel Raoul +Copyright (c) 2018-2022 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 5801c96..06d8abf 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,8 @@ Faker Wi-Fi ESSID ================= -|PyPI Package| |Build Status| +|PyPI Package| |PyPI Downloads| |PyPI Python Versions| |Build Status| |LGTM +Grade| |LGTM Alerts| `Faker `__ provider for Wi-Fi ESSIDs. @@ -33,9 +34,26 @@ License `MIT `__ -.. |Build Status| image:: https://github.com/SkypLabs/faker-wifi-essid/actions/workflows/test.yml/badge.svg?branch=develop - :target: https://github.com/SkypLabs/faker-wifi-essid/actions/workflows/test.yml +.. |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 -.. |PyPI Package| image:: https://badge.fury.io/py/faker-wifi-essid.svg - :target: https://badge.fury.io/py/faker-wifi-essid - :alt: PyPI Package + +.. |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 + +.. |PyPI Package| image:: https://img.shields.io/pypi/v/faker-wifi-essid.svg?style=flat + :target: https://pypi.org/project/faker-wifi-essid/ + :alt: PyPI Package Latest Release + +.. |PyPI Python Versions| image:: https://img.shields.io/pypi/pyversions/faker-wifi-essid.svg?logo=python&style=flat + :target: https://pypi.org/project/faker-wifi-essid/ + :alt: PyPI Package Python Versions diff --git a/docs/conf.py b/docs/conf.py index af0576b..27956a4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ # -- Project information ----------------------------------------------------- project = 'Faker Wi-Fi ESSID' -copyright = '2021, Paul-Emmanuel Raoul' +copyright = '2022, Paul-Emmanuel Raoul' author = 'Paul-Emmanuel Raoul' # The full version, including alpha/beta/rc tags diff --git a/docs/documentation.rst b/docs/documentation.rst index 43b922c..4214ccd 100644 --- a/docs/documentation.rst +++ b/docs/documentation.rst @@ -2,12 +2,14 @@ Documentation ============= -The documentation is written with `Sphinx`_ and is available in the `docs` folder. +The documentation is written with `Sphinx`_ and is available in the `docs` +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 `setup.py` +as an optional dependency group called `docs`. To install the dependencies in `docs`: @@ -19,7 +21,8 @@ To install the dependencies in `docs`: Build the documentation ----------------------- -Sphinx provides a `Makefile` to build the documentation easily. Several output formats are available. +Sphinx provides a `Makefile` to build the documentation easily. Several output +formats are available. For example, to build the documentation in HTML: @@ -30,6 +33,7 @@ For example, to build the documentation in HTML: The documentation website will be available in `docs/_build/html`. -To see the full list of the supported output formats, just execute `make` without any specific target. +To see the full list of the supported output formats, just execute `make` +without any specific target. .. _Sphinx: https://www.sphinx-doc.org diff --git a/docs/installation.rst b/docs/installation.rst index 03abba1..96f20a9 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -2,7 +2,7 @@ Installation ============ -Using pip (recommended) +From PyPI (recommended) ----------------------- :: @@ -14,12 +14,13 @@ From sources 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 `master` branch. +The default Git branch is `develop`. To install the latest stable version, you +need to clone the `main` branch. :: - git clone -b master git@github.com:SkypLabs/faker-wifi-essid.git + git clone -b main git@github.com:SkypLabs/faker-wifi-essid.git cd faker-wifi-essid - python3 setup.py install + pip3 install . .. _Setuptools: https://pypi.org/project/setuptools/ diff --git a/docs/usage.rst b/docs/usage.rst index 04eeb68..6ff942d 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -7,7 +7,8 @@ Just like with any other Faker provider, to use Faker Wi-Fi ESSID, you need to: 1. Import Faker and Faker Wi-Fi ESSID. 2. Create an instance of Faker. 3. Add :py:class:`faker_wifi_essid.WifiESSID` to the Faker instance. -4. Call :py:meth:`faker_wifi_essid.WifiESSID.wifi_essid` or any other relevant method. +4. Call :py:meth:`faker_wifi_essid.WifiESSID.wifi_essid` or any other relevant + method. .. code-block:: python diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4602018 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = [ + "setuptools >= 42", + "setuptools_scm >= 2.0.0, <3", + "wheel", +] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..fc3fa30 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,39 @@ +[metadata] +name = faker_wifi_essid +version = 0.4.0 +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/setup.py b/setup.py deleted file mode 100644 index b58a1fc..0000000 --- a/setup.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -""" -Setuptools build system configuration file -for Faker Wi-Fi ESSID. - -See https://setuptools.readthedocs.io. -""" - -try: - from setuptools import setup, find_packages -except Exception as setuptools_not_present: - raise ImportError( - "Setuptools is required to install Faker Wi-Fi ESSID!" - ) from setuptools_not_present - -from codecs import open as fopen -from os.path import dirname, abspath, join - -DIR = dirname(abspath(__file__)) - -VERSION = "0.3.1" - -URL = "https://github.com/SkypLabs/faker-wifi-essid" -DL_URL = URL + "/archive/v{0}.zip" - -with fopen(join(DIR, "README.rst"), encoding="utf-8") as f: - LONG_DESCRIPTION = f.read() - -setup( - name="faker_wifi_essid", - version=VERSION, - description="Faker provider for Wi-Fi ESSIDs.", - long_description=LONG_DESCRIPTION, - license="MIT", - keywords="faker faker-library faker-provider faker-generator wifi essid", - author="Paul-Emmanuel Raoul", - author_email="skyper@skyplabs.net", - url=URL, - download_url=DL_URL.format(VERSION), - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Topic :: Software Development :: Libraries :: Python Modules", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "License :: OSI Approved :: MIT License", - ], - packages=find_packages( - exclude=[ - "doc*", - "test*", - ], - ), - python_requires=">=3.5, <4", - install_requires=[ - "Faker >= 4.1,< 9.0", - ], - extras_require={ - "tests": [ - "flake8", - "pylint", - "tox" - ], - "docs": [ - "Sphinx >= 3.2", - "sphinx_rtd_theme >= 0.5.0", - ], - }, -) diff --git a/faker_wifi_essid/__init__.py b/src/faker_wifi_essid/__init__.py similarity index 100% rename from faker_wifi_essid/__init__.py rename to src/faker_wifi_essid/__init__.py diff --git a/faker_wifi_essid/common_essids.py b/src/faker_wifi_essid/common_essids.py similarity index 100% rename from faker_wifi_essid/common_essids.py rename to src/faker_wifi_essid/common_essids.py diff --git a/faker_wifi_essid/wifi_essid.py b/src/faker_wifi_essid/wifi_essid.py similarity index 100% rename from faker_wifi_essid/wifi_essid.py rename to src/faker_wifi_essid/wifi_essid.py diff --git a/test/__init__.py b/tests/__init__.py similarity index 100% rename from test/__init__.py rename to tests/__init__.py diff --git a/test/test.py b/tests/test_wifi_essid.py similarity index 100% rename from test/test.py rename to tests/test_wifi_essid.py diff --git a/tox.ini b/tox.ini index 25039be..6170389 100644 --- a/tox.ini +++ b/tox.ini @@ -4,34 +4,32 @@ # and then run "tox" from this directory. [tox] -envlist = py35, py36, py37, py38, flake8, pylint +envlist = py37, py38, py39, py310, flake8, pylint skip_missing_interpreters = true minversion = 3.0 +isolated_build = true [testenv] description = "Faker Wi-Fi ESSID's unit tests" commands = - {envpython} -m unittest discover + {envpython} -m unittest discover -s tests [testenv:flake8] description = "Check Faker Wi-Fi ESSID's code style & quality" -basepython = python3 deps = flake8 commands = - {envpython} -m flake8 faker_wifi_essid + {envpython} -m flake8 src tests [testenv:pylint] description = "Check Faker Wi-Fi ESSID for programming errors" -basepython = python3 deps = pylint -changedir = test commands = - {envpython} -m pylint faker_wifi_essid + {envpython} -m pylint src tests -[travis] -description = "tox configuration when running on Travis CI" +[gh-actions] +description = "tox configuration when running on GitHub Actions" python = - 3.5: py35 - 3.6: py36 - 3.7: py37 + 3.7: py37, flake8, pylint 3.8: py38, flake8, pylint + 3.9: py39, flake8, pylint + 3.10: py310, flake8, pylint