diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index aab7e939..e9e2a20e 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -12,17 +12,13 @@ jobs: steps: - uses: actions/checkout@v2 - name: Cargo Build - run: cargo build --verbose + run: cargo build - name: Cargo Tests - run: cargo test --verbose + run: cargo test - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - - name: Install python test dependencies - run: | - python -m pip install --upgrade pip - pip install -r python_client/test-requirements.txt - name: Lint with flake8 run: | pip install flake8 @@ -38,9 +34,8 @@ jobs: - name: Test Python Client run: | export THROTTLE_LOG=debug - pip install pytest - pip install -e ./python_client - pytest python_client/tests -v + pip install -e .[test] + pytest -v dependabot: needs: [test] diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index e8dc03d0..06e4d33b 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -18,15 +18,12 @@ jobs: uses: actions/setup-python@v1 with: python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - cd python_client - python setup.py sdist bdist_wheel + python -m pip install --upgrade pip + pip install bulid + python -m build twine upload dist/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 285e0880..d3ac2e22 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,6 @@ Wether they be in code, intersting feature suggestions, design critique or bug r ```bash cd python_client - pip install -r test-requirements.txt - pip install -e . + pip install -e .[test] pytest ``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..d921b73c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,25 @@ +[project] +name = "throttle_client" +version = "0.4.5" +authors = [{ name = "Markus Klein " }] +license = { text = "MIT License" } +description = "Client for Throttle. Throttle is an http semaphore service, providing semaphores for distributed systems." +readme = "Readme.md" +requires-python = ">=3.6" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dependencies = [ + "requests", "tenacity" +] + +[project.optional-dependencies] +test = ["pytest"] + +[project.urls] +Repository = "https://github.com/pacman82/throttle.git" + +[tool.setuptools.packages.find] +where = ["python_client"] \ No newline at end of file diff --git a/python_client/setup.py b/python_client/setup.py deleted file mode 100644 index 310107cf..00000000 --- a/python_client/setup.py +++ /dev/null @@ -1,23 +0,0 @@ -from setuptools import setup - -with open("../Readme.md", "r") as file: - long_description = file.read() - -setup( - name="throttle_client", - version="0.4.5", - author="Markus Klein", - description="Client for Throttle. Throttle is an http semaphore service, " - "providing semaphores for distributed systems.", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/pacman82/throttle.git", - packages=["throttle_client"], - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - install_requires=["requests", "tenacity"], - python_requires=">=3.6", -) diff --git a/python_client/test-requirements.txt b/python_client/test-requirements.txt deleted file mode 100644 index 55b033e9..00000000 --- a/python_client/test-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pytest \ No newline at end of file