From 4d372939640967db09df9e64d6dbffd31ea191d2 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Fri, 22 Dec 2023 10:19:25 +0200 Subject: [PATCH] Remove mentions of Travis CI (#126) * Remove mentions of Travis CI * Fix a typo --------- Co-authored-by: Ray Luo --- .travis.yml | 106 ---------------------------------- setup.py | 5 +- tests/test_persistence.py | 15 +++-- tests/test_windows_backend.py | 30 ++++------ tox.ini | 1 - 5 files changed, 20 insertions(+), 137 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7fb4663..0000000 --- a/.travis.yml +++ /dev/null @@ -1,106 +0,0 @@ -language: python - -matrix: - fast_finish: true - include: - - python: "2.7" - env: TOXENV=py27 PYPI=true - os: linux - before_install: - - sudo apt update - - sudo apt install python-dev libgirepository1.0-dev libcairo2-dev gir1.2-secret-1 - - pip install --upgrade pip - - python: "3.5" - env: TOXENV=py35 - os: linux - before_install: - - sudo apt update - - sudo apt install python3-dev libgirepository1.0-dev libcairo2-dev gir1.2-secret-1 - - pip install --upgrade pip - - ## Somehow cryptography is not able to be compiled and installed on Python 3.6 - #- python: "3.6" - # env: - # - TOXENV=py36 - # - CRYPTOGRAPHY_DONT_BUILD_RUST=1 - # os: linux - # before_install: - # - sudo apt update - # - sudo apt install python3-dev libgirepository1.0-dev libcairo2-dev gir1.2-secret-1 - # - pip install --upgrade pip - - - python: "3.7" - env: TOXENV=py37 - os: linux - dist: xenial - before_install: - - sudo apt update - - sudo apt install python3-dev libgirepository1.0-dev libcairo2-dev gir1.2-secret-1 - - pip install --upgrade pip - - python: "3.8" - env: TOXENV=py38 - os: linux - dist: xenial - before_install: - - sudo apt update - - sudo apt install python3-dev libgirepository1.0-dev libcairo2-dev gir1.2-secret-1 - - pip install --upgrade pip - - name: "Python 3.7 on macOS" - env: TOXENV=py37 - os: osx - osx_image: xcode10.2 - language: shell - - name: "Python 2.7 on Windows" - env: TOXENV=py27 PATH=/c/Python27:/c/Python27/Scripts:$PATH - os: windows - before_install: - - choco install python2 - - pip install --upgrade --user pip - language: shell - - name: "Python 3.5 on Windows" - env: TOXENV=py35 PATH=/c/Python35:/c/Python35/Scripts:$PATH - os: windows - before_install: - - choco install python3 --version 3.5.4 - - pip install --upgrade --user pip - language: shell - - name: "Python 3.7 on Windows" - env: TOXENV=py37 PATH=/c/Python37:/c/Python37/Scripts:$PATH - os: windows - before_install: - - choco install python3 --version 3.7.3 - - pip install --upgrade --user pip - language: shell - -install: - - pip install tox pylint - - pip install . - -script: - - # Difficult to get .pylintrc working on both Python 2 & 3, and we don't have to - - if [ "$TOXENV" = "py37"]; then pylint msal_extensions; fi - - tox - -deploy: - - # test pypi - provider: pypi - distributions: "sdist bdist_wheel" - server: https://test.pypi.org/legacy/ - user: "nugetaad" - password: - secure: dpNi6BsZyiAx/gkxJ5Mz6m2yDz2dRGWsSgS5pF+ywNzgHJ6+0e234GyLbSUY5bFeeA7WtOr4is3bxSLB/6tTWDVWdw3TL4FGlDM/54MSLWg8R5bR9PRwO+VU1kvQ03yz+B9mTpzuiwL2e+OSwcwo97jForADzmSRA5OpEq5Z7zAs7WR8J2tyhl+288NwLtKJMVy39UmPl9oifu6/5RfBn7EWLmC7MrMFhHTb2Gj7fJWw4u+5vx9bsQ7ubfiwPbRAtYXLz6wDMtwtFzwme4zZPg5HwWCn0WWlX4b6x7xXirZ7yKsy9iACLgTrLMeAkferrex7f03NFeIDobasML+fLbZufATaL3M97kNGZwulEYNp2+RWyLu/NW6FoZCbS+cSL8HuFnkIDHzEoO56ItMiD9EH47q/NeKgwrrzKjfY+KzaMQOYLlVgCa4WrIeFh5CkwJ4RHrfanMIV2vbEvMxsnHc/mZ+yvgBOFoBNXYN1HEDzEv1NxDPcyt7MBlPUVinEreQaHba7w6qH9Rf0eWgfW2ypBXe+nHaZxQgaGC6J+WGUkzalYQspmHVU4CcuwJa55kuchJs/gbyZKkyK6P8uD5IP6VZiavwZcjWcfvwbZaLeOqzSDVCDMg8M2zYZHoa+6ZR4EgDVW7RvaRvjvvhPTPj5twmLf3YYVJtHIyJSLug= - on: - branch: master - tags: false - condition: $PYPI = "true" - - - # production pypi - provider: pypi - distributions: "sdist bdist_wheel" - user: "nugetaad" - password: - secure: dpNi6BsZyiAx/gkxJ5Mz6m2yDz2dRGWsSgS5pF+ywNzgHJ6+0e234GyLbSUY5bFeeA7WtOr4is3bxSLB/6tTWDVWdw3TL4FGlDM/54MSLWg8R5bR9PRwO+VU1kvQ03yz+B9mTpzuiwL2e+OSwcwo97jForADzmSRA5OpEq5Z7zAs7WR8J2tyhl+288NwLtKJMVy39UmPl9oifu6/5RfBn7EWLmC7MrMFhHTb2Gj7fJWw4u+5vx9bsQ7ubfiwPbRAtYXLz6wDMtwtFzwme4zZPg5HwWCn0WWlX4b6x7xXirZ7yKsy9iACLgTrLMeAkferrex7f03NFeIDobasML+fLbZufATaL3M97kNGZwulEYNp2+RWyLu/NW6FoZCbS+cSL8HuFnkIDHzEoO56ItMiD9EH47q/NeKgwrrzKjfY+KzaMQOYLlVgCa4WrIeFh5CkwJ4RHrfanMIV2vbEvMxsnHc/mZ+yvgBOFoBNXYN1HEDzEv1NxDPcyt7MBlPUVinEreQaHba7w6qH9Rf0eWgfW2ypBXe+nHaZxQgaGC6J+WGUkzalYQspmHVU4CcuwJa55kuchJs/gbyZKkyK6P8uD5IP6VZiavwZcjWcfvwbZaLeOqzSDVCDMg8M2zYZHoa+6ZR4EgDVW7RvaRvjvvhPTPj5twmLf3YYVJtHIyJSLug= - on: - branch: master - tags: true - condition: $PYPI = "true" diff --git a/setup.py b/setup.py index a873d88..3cebcd3 100644 --- a/setup.py +++ b/setup.py @@ -8,10 +8,7 @@ io.open('msal_extensions/__init__.py', encoding='utf_8_sig').read() ).group(1) -try: - long_description = open('README.md').read() -except OSError: - long_description = "README.md is not accessible on TRAVIS CI's Python 3.5" +long_description = open('README.md').read() setup( name='msal-extensions', diff --git a/tests/test_persistence.py b/tests/test_persistence.py index eab4048..d451225 100644 --- a/tests/test_persistence.py +++ b/tests/test_persistence.py @@ -19,7 +19,6 @@ def _is_env_var_defined(env_var): # Note: If you use tox, remember to pass them through via tox.ini # https://tox.wiki/en/latest/example/basic.html#passing-down-environment-variables -is_running_on_travis_ci = _is_env_var_defined("TRAVIS") is_running_on_github_ci = _is_env_var_defined("GITHUB_ACTIONS") @pytest.fixture @@ -46,45 +45,45 @@ def test_nonexistent_file_persistence(temp_location): _test_nonexistent_persistence(FilePersistence(temp_location)) @pytest.mark.skipif( - is_running_on_travis_ci or not sys.platform.startswith('win'), + not sys.platform.startswith('win'), reason="Requires Windows Desktop") def test_file_persistence_with_data_protection(temp_location): try: _test_persistence_roundtrip(FilePersistenceWithDataProtection(temp_location)) except PersistenceDecryptionError: - if is_running_on_github_ci or is_running_on_travis_ci: + if is_running_on_github_ci: logging.warning("DPAPI tends to fail on Windows VM. Run this on your desktop to double check.") else: raise @pytest.mark.skipif( - is_running_on_travis_ci or not sys.platform.startswith('win'), + not sys.platform.startswith('win'), reason="Requires Windows Desktop") def test_nonexistent_file_persistence_with_data_protection(temp_location): _test_nonexistent_persistence(FilePersistenceWithDataProtection(temp_location)) @pytest.mark.skipif( not sys.platform.startswith('darwin'), - reason="Requires OSX. Whether running on TRAVIS CI does not seem to matter.") + reason="Requires OSX.") def test_keychain_persistence(temp_location): _test_persistence_roundtrip(KeychainPersistence(temp_location)) @pytest.mark.skipif( not sys.platform.startswith('darwin'), - reason="Requires OSX. Whether running on TRAVIS CI does not seem to matter.") + reason="Requires OSX.") def test_nonexistent_keychain_persistence(temp_location): random_service_name = random_account_name = str(id(temp_location)) _test_nonexistent_persistence( KeychainPersistence(temp_location, random_service_name, random_account_name)) @pytest.mark.skipif( - is_running_on_travis_ci or not sys.platform.startswith('linux'), + not sys.platform.startswith('linux'), reason="Requires Linux Desktop. Headless or SSH session won't work.") def test_libsecret_persistence(temp_location): _test_persistence_roundtrip(LibsecretPersistence(temp_location)) @pytest.mark.skipif( - is_running_on_travis_ci or not sys.platform.startswith('linux'), + not sys.platform.startswith('linux'), reason="Requires Linux Desktop. Headless or SSH session won't work.") def test_nonexistent_libsecret_persistence(temp_location): random_schema_name = random_value = str(id(temp_location)) diff --git a/tests/test_windows_backend.py b/tests/test_windows_backend.py index 64e9694..6de0094 100644 --- a/tests/test_windows_backend.py +++ b/tests/test_windows_backend.py @@ -27,24 +27,18 @@ def test_dpapi_roundtrip_with_entropy(): uuid.uuid4().hex, ] - try: - for tc in test_cases: - ciphered = subject_with_entropy.protect(tc) - assert ciphered != tc - - got = subject_with_entropy.unprotect(ciphered) - assert got == tc - - ciphered = subject_without_entropy.protect(tc) - assert ciphered != tc - - got = subject_without_entropy.unprotect(ciphered) - assert got == tc - except OSError as exp: - if exp.errno == errno.EIO and os.getenv('TRAVIS_REPO_SLUG'): - pytest.skip('DPAPI tests are known to fail in TravisCI. This effort tracked by ' - 'https://github.com/AzureAD/microsoft-authentication-extentions-for-python' - '/issues/21') + for tc in test_cases: + ciphered = subject_with_entropy.protect(tc) + assert ciphered != tc + + got = subject_with_entropy.unprotect(ciphered) + assert got == tc + + ciphered = subject_without_entropy.protect(tc) + assert ciphered != tc + + got = subject_without_entropy.unprotect(ciphered) + assert got == tc def test_read_msal_cache_direct(): diff --git a/tox.ini b/tox.ini index 29a2606..b4d2e41 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,6 @@ envlist = py27,py35,py36,py37,py38,py39,py310,py311,py312 [testenv] deps = pytest passenv = - TRAVIS GITHUB_ACTIONS commands =