diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..71ba6e0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release to PyPi + +on: + release: + types: [published] + +jobs: + deploy: + name: upload release to PyPI + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index 8853646..2b776a3 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -17,6 +17,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' # You can test your matrix by printing the current Python version - name: Install deps run: pip install -U setuptools pep8 coverage docutils pygments packaging pytest pytest-cov ${{ matrix.dependencies }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8a30d01..0000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -sudo: false -cache: -- pip -language: python -arch: - - amd64 - - ppc64le - - arm64 -python: - - '3.8' - - '3.9' - - '3.10' - - '3.11' - - pypy - -matrix: - exclude: - - arch: ppc64le - python: pypy - - arch: arm64 - python: pypy - - env: - - DEPEENDENCIES="flask==1.1" - -env: -- DEPEENDENCIES="flask==0.10.1 werkzeug==0.16.1" # pin werkzeug for Flask 10, 10.1 since Flask does not pin it itself. -- DEPEENDENCIES="flask==0.10 werkzeug==0.16.1" -- DEPEENDENCIES="flask==1.0" -- DEPEENDENCIES="flask==1.1" -- DEPEENDENCIES="flask==2.3.2" - -install: - - pip install -U setuptools pep8 coverage docutils pygments packaging $DEPEENDENCIES - -script: - - coverage erase - - nosetests --with-coverage --cover-package=flask_cors - - python setup.py clean build install - -after_success: - - pep8 flask_cors.py - -deploy: - provider: pypi - user: CoryDolphin - password: - secure: c/z1OYmniNlJ7F7G+TipOlJfVLCEz0F09JCJJ4+TPB/DTxajxarMEygX/LrvBOLvbe1EvAKO9p/SOagAul00YXU/rb2i1k1tJnKF2A6KKSLOsZbTcGWNcInOaLKql4Cv8Ts1cOfMiTVHBQLR+1FCw+IuZ44N+KhF0tsFOejEmRc= - distributions: "sdist bdist_wheel" - on: - tags: true - repo: corydolphin/flask-cors diff --git a/flask_cors/extension.py b/flask_cors/extension.py index 1d2d938..c00cbff 100644 --- a/flask_cors/extension.py +++ b/flask_cors/extension.py @@ -160,7 +160,7 @@ def init_app(self, app, **kwargs): for (pattern, opts) in resources ] - # Create a human readable form of these resources by converting the compiled + # Create a human-readable form of these resources by converting the compiled # regular expressions into strings. resources_human = {get_regexp_pattern(pattern): opts for (pattern,opts) in resources} LOG.debug("Configuring CORS with resources: %s", resources_human)