diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..dea5324a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,123 @@ +name: main + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + permissions: + contents: read + + strategy: + fail-fast: false + matrix: + name: [ + "py-27", + "py-33", + "py-34", + "py-35", + "py-36", + "py-37", + "py-38", + "py-39", + "pypy-36", + "pypy-27" + ] + + include: + - name: "py-27" + python: "2.7" + os: ubuntu-latest + - name: "py-33" + python: "3.3" + os: ubuntu-latest + container: true + - name: "py-34" + python: "3.4" + os: ubuntu-latest + container: true + - name: "py-35" + python: "3.5" + os: ubuntu-latest + - name: "py-36" + python: "3.6" + os: ubuntu-latest + - name: "py-37" + python: "3.7" + os: ubuntu-latest + - name: "py-38" + python: "3.8" + os: ubuntu-latest + - name: "py-39" + python: "3.9" + os: ubuntu-latest + - name: "pypy-36" + python: "pypy-3.6-v7.3.2" + os: ubuntu-latest + container: true + - name: "pypy-27" + python: "pypy-2.7.13-v7.3.2" + os: ubuntu-latest + container: true + + steps: + - uses: actions/checkout@v2 + - uses: docker://ubuntu:trusty + if: "matrix.container" + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- + + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-versions }} + + - name: Install dependencies + run: | + pip install --upgrade --force-reinstall "setuptools; python_version != '3.3'" "setuptools < 40; python_version == '3.3'" + pip uninstall --yes six || true + pip install --upgrade --force-reinstall --ignore-installed -e . + pip install "pytest==4.6.9; python_version != '3.3'" "pytest==2.9.2; python_version == '3.3'" "typing; python_version < '3'" + pip list --format=columns || pip list + + - name: Test + run: | + py.test + echo Checking whether installation flow is not broken... + pip uninstall --yes six || true + pip install --ignore-installed . + pip list --format=columns || pip list + + deploy: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + needs: [build] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.9" + + - name: Install dependencies + run: | + pip install wheel + + - name: Build package + run: | + python setup.py sdist bdist_wheel + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 890f584a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -os: linux -dist: focal -language: python -python: -- 2.7 -- 3.5 -- 3.6 -- 3.7 -- 3.8 -- &mainstream_python 3.9 -- nightly -- pypy3 -install: -- pip install --upgrade --force-reinstall "setuptools; python_version != '3.3'" "setuptools < 40; python_version == '3.3'" -- pip uninstall --yes six || true -- pip install --upgrade --force-reinstall --ignore-installed -e . -- pip install "pytest==4.6.9; python_version != '3.3'" "pytest==2.9.2; python_version == '3.3'" "typing; python_version < '3'" -- &py_pkg_list pip list --format=columns || pip list -script: -- py.test -- echo Checking whether installation flow is not broken... -- pip uninstall --yes six || true -- pip install --ignore-installed . -- *py_pkg_list -jobs: - fast_finish: true - include: - - python: 3.3 - dist: trusty - - python: 3.4 - dist: trusty - - python: pypy - dist: trusty - - stage: upload new version of python package to PYPI (only for tagged commits) - python: *mainstream_python - install: skip - script: skip - deploy: - provider: pypi - on: - tags: true - all_branches: true - python: *mainstream_python - user: __token__ - distributions: "sdist bdist_wheel" - password: - secure: "F83KFmQnpBcR/BD7tBjJcmchvvoxYjIB0EDmDKEM+Rq1SJUH0qtYZlMJ0H4S8sTeY4+h26Ssfg5+oe9SqS5AkEMLFVM2lDcFtIXNR9bIvsXjkKsdxIWZJJ+Vl7EmW+ND/oj9IWnHOvaPr6F1YQqOuP2LfrDsoZ+4wo4X+UCC8xCGCaAIliPIt6y7U3ENeCQJTwUc93eDMZrEROmWAwsxF54a13CIkbTWe+S3iEp949MaNBWx2f9XNi7Gidk2gKUKordK0MXiO7+DcrQdiCAtPryqqNKR/JjZ66P9eK1A2VWyk65/5E8+OJeexuSlHGg52HKoXU2BPIkzgcaSjt79WQKVKJzYi2iD0Bd/9/RKrnq8+GVd0yT5IJV5OhwcpT0ScPs/9pAZ1mSEufx1FtXN61ujs2VEuleSQAWBiNGXsRQNCzVxgfatkUTNMjB0jxUzNay5CFrMlo5AVWBcdByhUto3szV/lxLj7arM48GHXaf+5MXhaELU8L2pTpJoQ8Rdj+Tx5HbhJ+wWF6EyT919prB2/6fM4d/MHIuHfJkCasYZSvhamGnTBzxxH9Fv7l18FyrBXF+Rz65mXVkUlxFMICSMWRJWEb4I2KWK1bsxCFy+o38TMeije+1nbvKVRKbLMn6mbXfBb/wfLTNogHFXrlR5VcugcP079dqR9O3iV4M=" - -cache: - pip: true -after_failure: -- echo "Here's a list of installed Python packages:" -- *py_pkg_list diff --git a/test_six.py b/test_six.py index 076b3eb0..eaad1fc6 100644 --- a/test_six.py +++ b/test_six.py @@ -1050,3 +1050,8 @@ def test_ensure_text(self): assert converted_unicode == self.UNICODE_EMOJI and isinstance(converted_unicode, str) # PY3: bytes -> str assert converted_binary == self.UNICODE_EMOJI and isinstance(converted_unicode, str) + + +def test_foo(): + foo = "FOO" + assert foo == "FOO"