diff --git a/.circleci/circle_requirements.txt b/.circleci/circle_requirements.txt deleted file mode 100644 index 1c010d2..0000000 --- a/.circleci/circle_requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -poetry>=1.1.6 -tox>=3.23.1 -tox-poetry>=0.3.0 diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0779184..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: 2.1 - -commands: - - abort_for_docs: - steps: - - run: - name: Avoid tests for docs - command: | - if [[ $CIRCLE_BRANCH == *docs ]]; then - echo "Identifies as documents PR, no testing required" - circleci step halt - fi - - abort_for_noci: - steps: - - run: - name: Ignore CI for specific branches - command: | - if [[ $CIRCLE_BRANCH == *noci ]]; then - echo "Identifies as actively ignoring CI, no testing required." - circleci step halt - fi - - - early_return_for_forked_pull_requests: - description: >- - If this build is from a fork, stop executing the current job and return success. - This is useful to avoid steps that will fail due to missing credentials. - steps: - - run: - name: Early return if this build is from a forked PR - command: | - if [[ -n "$CIRCLE_PR_NUMBER" ]]; then - echo "Nothing to do for forked PRs, so marking this step successful" - circleci step halt - fi - - build_and_test: - steps: - - checkout - - - run: - name: install tox dependencies - command: | - sudo pip install --upgrade pip virtualenv - sudo pip install --quiet -r .circleci/circle_requirements.txt - - - run: - name: build sdist and wheels - command: | - poetry config virtualenvs.create false - poetry build - - - run: - name: lint - command: | - tox -e linters - no_output_timeout: 30m - - - run: - name: run tests - command: - tox -e tests - -jobs: - build: - parameters: - python_version: - type: string - default: "3.9.9" - docker: - - image: circleci/python:<> - - image: redislabs/redisai:edge-cpu-bionic - - steps: - - build_and_test - - store_artifacts: - path: test-reports - destination: test-reports - - nightly: - parameters: - python_version: - type: string - docker: - - image: circleci/python:<> - - image: redislabs/redisai:edge-cpu-bionic - steps: - - build_and_test - - dockerize - -on-any-branch: &on-any-branch - filters: - branches: - only: - - /.*/ - tags: - ignore: /.*/ - -on-master: &on-master - filters: - branches: - only: - - master - -python-versions: &python-versions - matrix: - parameters: - python_version: - - "3.6.9" - - "3.7.9" - - "3.8.9" - - "3.9.4" - # - "latest" # numpy wheel does not build in python 3.10. disabling for now. - -workflows: - version: 2 - commit: - jobs: - - build: - <<: *on-any-branch - <<: *python-versions - - nightly: - triggers: - - schedule: - cron: "0 0 * * *" - <<: *on-master - jobs: - - build diff --git a/.github/workflows/check-pypi.yml b/.github/workflows/check-pypi.yml index e1d5b10..074f15c 100644 --- a/.github/workflows/check-pypi.yml +++ b/.github/workflows/check-pypi.yml @@ -1,6 +1,11 @@ name: Check if required secrets are set to publish to Pypi -on: push +on: + push: + branches: + - 'master' + - 'main' + - '[0-9].[0-9]' jobs: checksecret: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..86223bd --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,46 @@ +--- + +on: + push: + + schedule: + - cron: "5 1 * * Sun-Thu" + +name: tests + +jobs: + build-and-test: + + services: + redisai: + image: redislabs/redisai:edge-cpu-bionic + ports: + - 6379:6379 + runs-on: ubuntu-latest + + strategy: + max-parallel: 10 + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11"] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{matrix.python-version}} + + # penidng: https://github.com/tkukushkin/tox-poetry/pull/16 + - name: install base dependencies + run: | + pip install -q tox==3.27.0 poetry tox-poetry + - name: cache + uses: actions/cache@v3 + with: + path: | + .tox + key: redisai-${{matrix.python_version}} + - name: build the package + run: | + poetry build + - name: test + run: | + tox -e tests diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 0000000..fd9d9e4 --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,25 @@ +--- + +on: + pull_request: + paths: + - 'redisai/**' + - 'pyproject.toml' + +name: lint + +env: + python_version: 3.9 + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{env.python_version}} + - name: lint + run: | + pip install -q tox poetry + tox -e linters diff --git a/pyproject.toml b/pyproject.toml index d6f8596..ebd1460 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,30 +14,28 @@ classifiers = [ 'Topic :: Database', 'Programming Language :: Python', 'Intended Audience :: Developers', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'License :: OSI Approved :: BSD License', 'Development Status :: 5 - Production/Stable' ] [tool.poetry.dependencies] -python = ">=3.6,<3.10" +python = ">=3.8,<=4.0.0" redis = "^4.1.4" hiredis = ">=0.20" numpy = ">=1.19.5" six = ">=1.10.0" Deprecated = "^1.2.12" +pytest = "^7.2.1" [tool.poetry.dev-dependencies] codecov = "^2.1.11" -flake8 = "^3.9.2" -rmtest = "^0.7.0" -nose = "^1.3.7" +flake8 = "<6.0.0" ml2rt = "^0.2.0" -tox = ">=3.23.1" +tox = ">=3.23.1,<=4.0.0" tox-poetry = "^0.3.0" Sphinx = "^4.1.2" sphinx-rtd-theme = "^0.5.2" @@ -47,7 +45,7 @@ toml = "^0.10.2" bandit = "^1.7.0" pylint = "^2.8.2" vulture = "^2.3" -scikit-image = "==0.16.2" +scikit-image = "^0.19.3" [tool.poetry.urls] "Project URL" = "https://redisai.io" diff --git a/tox.ini b/tox.ini index 69a64d7..58f6670 100644 --- a/tox.ini +++ b/tox.ini @@ -6,17 +6,21 @@ envlist = linters,tests max-complexity = 10 ignore = E501,C901 srcdir = ./redisai -exclude =.git,.tox,dist,doc,*/__pycache__/*,venv +exclude =.git,.tox,dist,doc,*/__pycache__/*,venv,.venv [testenv:tests] whitelist_externals = find commands_pre = pip install --upgrade pip commands = - nosetests -vsx test + poetry install --no-root --only dev + pytest test/test.py [testenv:linters] +allowlist_externals = + poetry commands = + poetry install --no-root --only dev flake8 --show-source vulture redisai --min-confidence 80 bandit redisai/**