From 075f0715cdf945c43edbdc46b47abcde53f21063 Mon Sep 17 00:00:00 2001 From: apocelipes Date: Tue, 25 Oct 2022 15:20:04 +0800 Subject: [PATCH] feat: upgrade dependencies to support python 3.10+ --- .coveragerc | 1 + .github/workflows/ci.yml | 71 ++++++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 28 ++++++++++++++ .pre-commit-config.yaml | 2 +- .travis.yml | 31 ---------------- CHANGELOG.md | 6 +++ pytest.ini | 2 +- requirements.txt | 5 ++- test-requirements.txt | 6 +-- 9 files changed, 114 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/deploy.yml delete mode 100644 .travis.yml diff --git a/.coveragerc b/.coveragerc index be0a5f74..3426f890 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,6 +3,7 @@ omit = *.tmpl versioneer.py */_version.py +relative_files = True [report] exclude_lines = diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7ee739f8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: 'pip' + - run: pip install -r test-requirements.txt -U + - name: Run git-lint + run: gitlint --commits "8d1d969b..HEAD" + - name: Run python code lint + run: flake8 sea --exclude=*_pb2.py + + tests: + name: "Python ${{ matrix.py-version }} unit-tests" + needs: lint + runs-on: ubuntu-latest + strategy: + matrix: + py-version: ['3.7', '3.8', '3.9', '3.10'] + services: + redis-server: + image: redis + ports: + - 6379:6379 + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.py-version }} + cache: 'pip' + - run: pip install -r test-requirements.txt -U + - name: Run test_celery_no_app + run: pytest tests/test_contrib/test_extensions/test_celery.py::test_celery_no_app --cov-fail-under=10 + - name: Run unit-tests + run: pytest tests --cov sea + - name: Coveralls Parallel + uses: AndreMiras/coveralls-python-action@develop + with: + flag-name: "Integration Test - ${{ matrix.py-version }}" + parallel: true + + report_coverage: + name: Report testing coverage + needs: tests + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: AndreMiras/coveralls-python-action@develop + with: + parallel-finished: true \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..8e795aed --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,28 @@ +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install -U pip setuptools + pip install wheel + - name: Build package + run: python setup.py bdist_wheel + - name: Publish a Python distribution to PyPI + if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 025a7f2b..375feae2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: hooks: - id: isort - repo: "https://github.com/ambv/black" - rev: 22.3.0 + rev: 22.8.0 hooks: - id: black language_version: python3 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c9723f4b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: python -cache: pip -services: -- redis-server -python: -- '3.6' -- '3.7' -- '3.8' -- '3.9' -install: -- pip install -U importlib-metadata -- pip list -- pip install -r test-requirements.txt -U -script: -- gitlint --commits "8d1d969b..HEAD" -- flake8 sea --exclude=*_pb2.py -- pytest tests/test_contrib/test_extensions/test_celery.py::test_celery_no_app --cov-fail-under=10 -- pytest tests -after_success: -- CODECLIMATE_REPO_TOKEN=19c5e18e184070a726bb6fc703e321e526ca638df16f9623654044bcccdb1a9d - codeclimate-test-reporter -- coveralls -deploy: - provider: pypi - distributions: bdist_wheel - user: __token__ - password: - secure: GhYElf7a0NzQYd3t6cjioHxdEJnqraCcMVB3WaUvfpB+6aTnpylPLwzUZJFFsICbgpFfjHyT6X9v62j3lgtljy6NTDC2iU/XgtZG4pr/Kqa06smJGLcZTzswPQBkWBHkVLD6PHEqRB8hk4q01Uzcm0THNPKZWB7WNQKC7PJ4PWPCi2mKIcSu9fPVdoiiYpdzkEqtzuuVoZxdz3Q/GDoy7K5DMs1j4dI/8M1mguUliBqIj0yBJCiAoDEnIneNRTJL6ZZW9m9P5n2gdZ0hmxetQ0Twt+2VQ179k7MVjJyox4V1h15A3VNyKvxc5HGkaUIKNQKUrR4TiZ7WLkunTlyF5gGfk9IzYtq8UpD0PQ1bn/UQYTkerWBWI0FpdR5iCVkw4nSpYKZhOm+c4ZUfhJRZkdA0mhtDtygwdJCLcLDr//FJKdFX6hN/ceBmXvz6nTndLo/nXt1LyLjb9VinI+/uDFO+vyIeBHhE5wYL3Qd3nIh9NwOTt0+j6NHs+sxyy5UFPxggVrTJm3tMANJEZ5xXQosschaUABk77+ULP1ap3UmEgoRccOMhsKQEPan2UH+zps/oyVxZqdqQ1ZwA1AJ+hX0n2+NGYQxVFcgd2M+mgu5IYESxbLB6YzcU1bumrs9A3s1sV4WAEI8Q6NBDEGlk6ioDVDSjMDRpFa0n2+Qs1j8= - on: - tags: true - python: '3.8' diff --git a/CHANGELOG.md b/CHANGELOG.md index c979182d..86ba007f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## [Unreleased] - 2022-10-25 + +### Changed +- Upgrade depebdebcies to support python 3.10+ +- Changed CI from Travis CI to Github Actions + ## [3.0.0] - 2022-06-24 ### Added diff --git a/pytest.ini b/pytest.ini index fc5772fa..8b649d77 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,2 @@ [pytest] -addopts = --strict -vvl --cov=sea --cov-report=term-missing --cov-fail-under=85 +addopts = --strict-markers -vvl --cov=sea --cov-report=term-missing --cov-fail-under=85 diff --git a/requirements.txt b/requirements.txt index 8a523346..435170c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ -grpcio>=1.27.0,<1.44.0 -grpcio-tools>=1.27.0,<1.44.0 +grpcio>=1.27.0,<1.49.0 +grpcio-tools>=1.27.0,<1.49.0 +protobuf<4.0.0 pendulum blinker jinja2 diff --git a/test-requirements.txt b/test-requirements.txt index a2329e34..94f70a42 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,12 +3,12 @@ peeweext cachext redis celery -pytest -pytest-cov +pytest>7.0.0 +pytest-cov>=4.0.0 flake8 coveralls codeclimate-test-reporter -coverage>=4.0,<6.4 +coverage>=4.0,<6.6 prometheus_client versioneer pre-commit