Skip to content

Commit

Permalink
Update CI workflow to support multiple Python versions and bump packa…
Browse files Browse the repository at this point in the history
…ge version to 0.5.0
  • Loading branch information
Buba98 committed Dec 19, 2024
1 parent 9543b43 commit 99459ae
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
45 changes: 22 additions & 23 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,35 @@ name: Python package

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='regex_enumerator',
version='0.4.2',
version='0.5.0',
packages=find_packages(include=['regex_enumerator', 'regex_enumerator.*']),
description='Enumerate all strings that match a given regex',
author='Vincenzo Greco',
Expand All @@ -18,4 +18,5 @@
'exhaustive-matching', 'regex-testing', 'regex-tools', 'string-enumeration', 'data-generation'],
long_description=long_description,
long_description_content_type="text/markdown",
python_requires='>=3.10',
)
9 changes: 6 additions & 3 deletions tests/test_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ def test_done():

f_finite(regexEnumerator, possibilities)


def test_weak_password():
regexEnumerator = RegexEnumerator(r'[Ll][Oo0][Vv][Ee3]([Yy][Oo0][Uu])?(2023|2024)[!1.]{1,2}')
regexEnumerator = RegexEnumerator(
r'[Ll][Oo0][Vv][Ee3]([Yy][Oo0][Uu])?(2023|2024)[!1.]{1,2}')
possibilities = []

you_or_not = []
Expand All @@ -34,14 +36,15 @@ def test_weak_password():
you_or_not.append(y + o + u)
you_or_not.append('')

for l in 'Ll':
for l_char in 'Ll':
for o in 'Oo0':
for v in 'Vv':
for e in 'Ee3':
for y in you_or_not:
for year in ['2023', '2024']:
for special_1 in ['!', '1', '.']:
for special_2 in ['!', '1', '.', '']:
possibilities.append(l + o + v + e + y + year + special_1 + special_2)
possibilities.append(
l_char + o + v + e + y + year + special_1 + special_2)

f_finite(regexEnumerator, possibilities)

0 comments on commit 99459ae

Please sign in to comment.