diff --git a/.github/workflows/main-build-and-publish.yml b/.github/workflows/main-build-and-publish.yml new file mode 100644 index 0000000..da8d65c --- /dev/null +++ b/.github/workflows/main-build-and-publish.yml @@ -0,0 +1,79 @@ +name: Test, build, and publish the package + +on: + push: + branches: [main] + +jobs: + test-build-and-publish: + name: Test, build, and publish the package + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + path: qless-py + submodules: true + token: ${{ secrets.PAT_GITHUB_ACTIONS }} + + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + sudo apt-get update && sudo apt-get install -y redis-server + python -m venv venv + source venv/bin/activate + pip install -r requirements.txt + working-directory: qless-py + + - name: Check style + run: | + source venv/bin/activate + make style + working-directory: qless-py + + - name: Run tests and build package + run: | + source venv/bin/activate + make nose + python -m build + working-directory: qless-py + + - name: Checkout tdg5/github-action-pack + uses: actions/checkout@v4 + with: + path: .github/actions/tdg5/github-action-pack + ref: v0.0.2 + repository: tdg5/github-action-pack + + - name: Increment version + uses: ./.github/actions/tdg5/github-action-pack/packages/increment-version-file-action/src + with: + authorEmail: dannyguinther@gmail.com + authorName: Danny Guinther + commitMessage: "[skip actions] Increment version for next development cycle" + repoPath: qless-py + versionFilePath: VERSION + versionFormat: python + + - name: Publish package to pypi + env: + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + TWINE_USERNAME: __token__ + run: | + source venv/bin/activate + python -m twine upload dist/* + working-directory: qless-py + + # Add the tag after publishing the package so it is more likely that we + # end up with a package without a tag than a tag without a package. + - name: Create and push tag for published version + run: | + VERSION="$(git show HEAD~1:VERSION)" + TAG_NAME="v${VERSION}" + git tag "$TAG_NAME" HEAD~1 + git push origin "$TAG_NAME" + working-directory: qless-py diff --git a/.github/workflows/other-check-quality-and-tests.yml b/.github/workflows/other-check-quality-and-tests.yml new file mode 100644 index 0000000..925cc7f --- /dev/null +++ b/.github/workflows/other-check-quality-and-tests.yml @@ -0,0 +1,47 @@ +name: Style, test, build, and publish the package + +on: + push: + branches-ignore: [main] + +jobs: + style-test-and-build: + name: Test, build, and publish the package + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + path: qless-py + submodules: true + + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + sudo apt-get update && sudo apt-get install -y redis-server + python -m venv venv + source venv/bin/activate + pip install -r requirements.txt + working-directory: qless-py + + - name: Check style + run: | + source venv/bin/activate + make style + git diff --quiet + if [ ! $? -eq 0 ]; then + echo "make style caused file changes, failing!" + exit 1 + fi + working-directory: qless-py + + - name: Run tests and build package + run: | + source venv/bin/activate + make nose + python -m build + working-directory: qless-py diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5b66894..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: false -services: - - redis-server -before_install: - - make qless-core -language: python -python: - - "2.7" - - "3.3" - - "3.4" - - "3.5" -install: pip install tox tox-travis -script: tox -addons: - apt: - packages: - - libevent-dev -cache: - directories: - - .tox - - $HOME/.cache/pip diff --git a/requirements.txt b/requirements.txt index 8d25e5d..bdc2889 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ appdirs==1.4.4 async-timeout==4.0.3 black==21.5b2 +build==1.0.3 certifi==2023.11.17 cffi==1.16.0 cfgv==3.4.0 @@ -11,6 +12,7 @@ coverage==7.3.0 cryptography==41.0.5 decorator==5.1.1 distlib==0.3.7 +docutils==0.20.1 dparse==0.6.3 filelock==3.13.1 funcsigs==0.4 @@ -19,34 +21,51 @@ greenlet==2.0.1 hiredis==2.2.3 identify==2.5.32 idna==3.4 +importlib-metadata==6.8.0 isort==5.8.0 +jaraco.classes==3.3.0 +jeepney==0.8.0 +keyring==24.3.0 +markdown-it-py==3.0.0 +mdurl==0.1.2 mock==1.3.0 +more-itertools==10.1.0 mypy==1.7.0 mypy-extensions==1.0.0 +nh3==0.2.15 nodeenv==1.8.0 nose==1.3.7 packaging==21.3 pathspec==0.11.2 pbr==1.8.1 +pkginfo==1.9.6 platformdirs==4.0.0 pre-commit==2.20.0 pycparser==2.21 pyflakes==3.1.0 +Pygments==2.17.2 pyparsing==3.1.1 +pyproject_hooks==1.0.0 python-termstyle==0.1.10 PyYAML==6.0.1 +readme-renderer==42.0 redis==5.0.0 rednose==1.1.1 regex==2023.10.3 removestar==1.3.1 requests==2.31.0 +requests-toolbelt==1.0.0 +rfc3986==2.0.0 +rich==13.7.0 ruamel.yaml==0.18.5 ruamel.yaml.clib==0.2.8 safety==2.3.5 +SecretStorage==3.3.3 setproctitle==1.3.2 six==1.16.0 toml==0.10.2 tomli==2.0.1 +twine==4.0.2 types-decorator==5.1.8.4 types-mock==5.1.0.2 types-pyOpenSSL==23.3.0.0 @@ -54,5 +73,6 @@ types-redis==4.6.0.11 typing_extensions==4.8.0 urllib3==2.1.0 virtualenv==20.24.7 +zipp==3.17.0 zope.event==5.0 zope.interface==6.0 diff --git a/setup.py b/setup.py index c0a3be3..f964264 100644 --- a/setup.py +++ b/setup.py @@ -22,12 +22,14 @@ def _long_description() -> Tuple[str, str]: _dev_dependencies = [ "black==21.5b2", + "build==1.0.3", "click<8.1", "isort==5.8.0", "mypy~=1.7.0", "pre-commit==2.20.0", "removestar==1.3.1", "safety==2.3.5", + "twine==4.0.2", "types-decorator==5.1.8.4", "types-mock==5.1.0.2", ]