diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index da81319..087d42d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,10 +28,11 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest - if [ -f dev-requirements.txt ]; then pip install -r dev-requirements.txt; fi + pip install --upgrade pip + pip install setuptools==57.5.0 + pip install flake8 pytest pip install . + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/pyproject.toml b/pyproject.toml index b5a3c46..a27b3df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=42", + "setuptools >= 42, < 58", "wheel" ] build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/requirement.txt b/requirement.txt index 1fa8931..ced629c 100644 --- a/requirement.txt +++ b/requirement.txt @@ -1,4 +1,4 @@ click==8.0.3 Cython==0.29.24 -pycrypto==2.6.1 +pycryptodome==3.14.1 pyminifier==2.1 diff --git a/setup.cfg b/setup.cfg index 2bc9959..c5d477b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Environment :: Console license_files = LICENSE @@ -28,9 +29,9 @@ keywords = python-encrypt, import-hook [options] install_requires = - Cython - pycrypto - pyminifier + Cython >= 0.29.24 + pycryptodome >= 3.14.1 + pyminifier >= 2.1 click python_requires = >=3.6 packages = find: diff --git a/tests/test_generate.py b/tests/test_generate.py index 800101c..09c0b6b 100644 --- a/tests/test_generate.py +++ b/tests/test_generate.py @@ -12,7 +12,7 @@ def test_generate_aes_key(size): assert isinstance(generate_aes_key(size), bytes) -@pytest.mark.parametrize('bits', [1024, 2048, 4096]) +@pytest.mark.parametrize('bits', [1024, 1025, 2045, 2048, 4096]) def test_generate_rsa_number(bits): numbers = generate_rsa_number(bits) assert len(numbers) == 5 @@ -24,8 +24,8 @@ def test_generate_rsa_number(bits): assert pow(pow(plain, e, n), d, n) == plain -@pytest.mark.parametrize('bits', [123, 456, 789]) +@pytest.mark.parametrize('bits', [-1, 123]) def test_generate_rsa_number_exception(bits): with pytest.raises(ValueError) as excinfo: generate_rsa_number(bits) - assert str(excinfo.value) == "RSA modulus length must be a multiple of 256 and >= 1024" \ No newline at end of file + assert str(excinfo.value) == "RSA modulus length must be >= 1024" \ No newline at end of file