diff --git a/.github/workflows/check_docs.yaml b/.github/workflows/check_docs.yaml index b5a8d9b2..0a9d2ef5 100644 --- a/.github/workflows/check_docs.yaml +++ b/.github/workflows/check_docs.yaml @@ -9,19 +9,19 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.8 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 - - name: Install dependencies - run: make install-dev + - name: Install dependencies + run: make install-dev - - name: Check async docstrings - run: make check-async-docstrings + - name: Check async docstrings + run: make check-async-docstrings - - name: Check docs building - run: make check-docs + - name: Check docs building + run: make check-docs diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index 72acf3a0..446f2c7f 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -20,18 +20,18 @@ jobs: max-parallel: 1 # no concurrency on this level, to not overshoot the test user limits steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: make install-dev + - name: Install dependencies + run: make install-dev - - name: Run integration tests - run: make INTEGRATION_TESTS_CONCURRENCY=8 integration-tests - env: - APIFY_TEST_USER_API_TOKEN: ${{ secrets.APIFY_TEST_USER_PYTHON_SDK_API_TOKEN }} + - name: Run integration tests + run: make INTEGRATION_TESTS_CONCURRENCY=8 integration-tests + env: + APIFY_TEST_USER_API_TOKEN: ${{ secrets.APIFY_TEST_USER_PYTHON_SDK_API_TOKEN }} diff --git a/.github/workflows/lint_and_type_checks.yaml b/.github/workflows/lint_and_type_checks.yaml index 008031d8..26b6aed9 100644 --- a/.github/workflows/lint_and_type_checks.yaml +++ b/.github/workflows/lint_and_type_checks.yaml @@ -12,19 +12,19 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: make install-dev + - name: Install dependencies + run: make install-dev - - name: Run lint - run: make lint + - name: Run lint + run: make lint - - name: Run type checks - run: make type-check + - name: Run type checks + run: make type-check diff --git a/.github/workflows/pr_toolkit.yaml b/.github/workflows/pr_toolkit.yaml index d59bb367..542644bf 100644 --- a/.github/workflows/pr_toolkit.yaml +++ b/.github/workflows/pr_toolkit.yaml @@ -5,7 +5,7 @@ on: pull_request: branches: - master - types: ['opened', 'reopened', 'synchronize', 'labeled', 'unlabeled', 'edited', 'ready_for_review'] # The first 3 are default. + types: [opened, reopened, synchronize, labeled, unlabeled, edited, ready_for_review] # The first 3 are default. concurrency: # This is to make sure that it's executed only for the most recent changes of PR. group: ${{ github.ref }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b9d8c7e7..719af4b2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,7 @@ on: branches: - master tags-ignore: - - '**' + - "**" # A release via GitHub releases will publish a stable version release: types: [published] @@ -14,14 +14,14 @@ on: workflow_dispatch: inputs: release_type: - description: 'Release type' + description: Release type required: true type: choice - default: 'alpha' + default: alpha options: - - 'alpha' - - 'beta' - - 'final' + - alpha + - beta + - final jobs: lint_and_type_checks: @@ -53,73 +53,73 @@ jobs: url: https://pypi.org/p/apify-client steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - - name: Install dependencies - run: make install-dev - - - # Determine if this is a prerelease or latest release - name: Determine release type - id: get-release-type - run: | - if [ ${{ github.event_name }} = release ]; then - release_type="final" - elif [ ${{ github.event_name }} = push ]; then - release_type="beta" - elif [ ${{ github.event_name }} = workflow_dispatch ]; then - release_type=${{ github.event.inputs.release_type }} - fi - - if [ ${release_type} = final ]; then - docker_image_tag="latest" - elif [ ${release_type} = beta ]; then - docker_image_tag="beta" - else - docker_image_tag="" - fi - - echo "release_type=${release_type}" >> $GITHUB_OUTPUT - echo "docker_image_tag=${docker_image_tag}" >> $GITHUB_OUTPUT - - - # Check whether the released version is listed in CHANGELOG.md - name: Check whether the released version is listed in the changelog - if: steps.get-release-type.outputs.release_type != 'alpha' - run: make check-changelog-entry - - - # Check version consistency and increment pre-release version number for prereleases (must be the last step before build) - name: Bump pre-release version - if: steps.get-release-type.outputs.release_type != 'final' - run: python ./scripts/update_version_for_prerelease.py ${{ steps.get-release-type.outputs.release_type }} - - - # Build a source distribution and a python3-only wheel - name: Build distribution files - run: make build - - - # Check whether the package description will render correctly on PyPI - name: Check package rendering on PyPI - run: make twine-check - - - # Publish package to PyPI using their official GitHub action - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - - - # Tag the current commit with the version tag if this is not made from the release event (releases are tagged with the release process) - name: Tag Version - if: github.event_name != 'release' - run: | - git_tag=v`python ./scripts/print_current_package_version.py` - git tag $git_tag - git push origin $git_tag - - - # Upload the build artifacts to the release - name: Upload the build artifacts to release - if: github.event_name == 'release' - run: gh release upload ${{ github.ref_name }} dist/* - env: - GH_TOKEN: ${{ github.token }} + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - name: Install dependencies + run: make install-dev + + - # Determine if this is a prerelease or latest release + name: Determine release type + id: get-release-type + run: | + if [ ${{ github.event_name }} = release ]; then + release_type="final" + elif [ ${{ github.event_name }} = push ]; then + release_type="beta" + elif [ ${{ github.event_name }} = workflow_dispatch ]; then + release_type=${{ github.event.inputs.release_type }} + fi + + if [ ${release_type} = final ]; then + docker_image_tag="latest" + elif [ ${release_type} = beta ]; then + docker_image_tag="beta" + else + docker_image_tag="" + fi + + echo "release_type=${release_type}" >> $GITHUB_OUTPUT + echo "docker_image_tag=${docker_image_tag}" >> $GITHUB_OUTPUT + + - # Check whether the released version is listed in CHANGELOG.md + name: Check whether the released version is listed in the changelog + if: steps.get-release-type.outputs.release_type != 'alpha' + run: make check-changelog-entry + + - # Check version consistency and increment pre-release version number for prereleases (must be the last step before build) + name: Bump pre-release version + if: steps.get-release-type.outputs.release_type != 'final' + run: python ./scripts/update_version_for_prerelease.py ${{ steps.get-release-type.outputs.release_type }} + + - # Build a source distribution and a python3-only wheel + name: Build distribution files + run: make build + + - # Check whether the package description will render correctly on PyPI + name: Check package rendering on PyPI + run: make twine-check + + - # Publish package to PyPI using their official GitHub action + name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + - # Tag the current commit with the version tag if this is not made from the release event (releases are tagged with the release process) + name: Tag Version + if: github.event_name != 'release' + run: | + git_tag=v`python ./scripts/print_current_package_version.py` + git tag $git_tag + git push origin $git_tag + + - # Upload the build artifacts to the release + name: Upload the build artifacts to release + if: github.event_name == 'release' + run: gh release upload ${{ github.ref_name }} dist/* + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 4a1b2714..fa7be76f 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -13,16 +13,16 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: make install-dev + - name: Install dependencies + run: make install-dev - - name: Run unit tests - run: make unit-tests + - name: Run unit tests + run: make unit-tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a753c3b3..334484ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,38 +1,38 @@ repos: -- repo: local - hooks: - - id: lint - name: "Lint codebase" - entry: "make lint" - language: system - pass_filenames: false + - repo: local + hooks: + - id: lint + name: Lint codebase + entry: make lint + language: system + pass_filenames: false - - id: check-async-docstrings - name: "Check whether async docstrings are aligned with sync ones" - entry: "make check-async-docstrings" - language: system - pass_filenames: false + - id: check-async-docstrings + name: Check whether async docstrings are aligned with sync ones + entry: make check-async-docstrings + language: system + pass_filenames: false - - id: type-check - name: "Type-check codebase" - entry: "make type-check" - language: system - pass_filenames: false + - id: type-check + name: Type-check codebase + entry: make type-check + language: system + pass_filenames: false - - id: unit-tests - name: "Run unit tests" - entry: "make unit-tests" - language: system - pass_filenames: false + - id: unit-tests + name: Run unit tests + entry: make unit-tests + language: system + pass_filenames: false - - id: check-docs - name: "Check whether docs are up-to-date" - entry: "make check-docs" - language: system - pass_filenames: false + - id: check-docs + name: Check whether docs are up-to-date + entry: make check-docs + language: system + pass_filenames: false - - id: check-changelog - name: "Check whether current version is mentioned in changelog" - entry: "make check-changelog-entry" - language: system - pass_filenames: false + - id: check-changelog + name: Check whether current version is mentioned in changelog + entry: make check-changelog-entry + language: system + pass_filenames: false diff --git a/mypy.ini b/mypy.ini index f5caf721..558312df 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,5 @@ [mypy] -python_version=3.8 +python_version = 3.8 files = docs, scripts, diff --git a/pytest.ini b/pytest.ini index 1a2cc47c..5231254c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] -asyncio_mode=auto +asyncio_mode = auto timeout = 1200