Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Poetry #106

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
name: Build and publish to PyPi
on: push
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to publish (v*.*.*)'
required: true
type: string

jobs:
build-n-publish:
name: Build and publish to PyPi
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade setuptools wheel
python -m pip install --upgrade poetry
poetry install
- name: Build
run: |
python setup.py sdist bdist_wheel
poetry build
- name: Configure Poetry credentials
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
- name: Publish
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry publish
13 changes: 7 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ jobs:
matrix:
# https://help.github.com/articles/virtual-environments-for-github-actions
platform:
- ubuntu-20.04 # ubuntu-20.04
- macos-latest # macOS-10.14
- windows-latest # windows-2019
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ]
- ubuntu-20.04
- macos-latest
- windows-latest
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
exclude:
- platform: macos-latest
python-version: '3.6'
- platform: macos-latest
python-version: '3.7'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ipython_config.py
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
Expand Down
11 changes: 9 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ To contribute, [fork](https://www.dynatrace.com/support/help/dynatrace-api) this
[Tests](#tests)
[Code formatting](#code-formatting)


<a name="setup"/>

## Setup
Expand All @@ -29,10 +28,18 @@ source .venv/bin/activate # On linux
# On Windows cmd: .venv/Scripts/activate.bat
```

You need Poetry on your system to be able to build and release the package.
If you don't have a system-wide installation of Poetry, you can install it
in the same virtual environment.

```shell
pip install poetry
```

Install the dev requirements:

```shell
pip install -r requirements_dev.txt
poetry install
```

Make sure tests pass:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ dt.settings.create_object(validate_only=False, body=settings_object)
ActiveGates | :heavy_check_mark: | `dt.activegates` |
ActiveGates - Auto-update configuration | :heavy_check_mark: | `dt.activegates_autoupdate_configuration` |
ActiveGates - Auto-update jobs | :heavy_check_mark: | `dt.activegates_autoupdate_jobs` |
ActiveGates - Remote configuration | :heavy_check_mark: | `dt.activegates_remote_configuration` |
Audit Logs | :heavy_check_mark: | `dt.audit_logs` |
Events | :warning: | `dt.events_v2` |
Extensions 2.0 | :heavy_check_mark: | `dt.extensions_v2` |
Expand All @@ -153,6 +154,7 @@ dt.settings.create_object(validate_only=False, body=settings_object)
Monitored entities | :warning: | `dt.entities` |
Monitored entities - Custom tags | :heavy_check_mark: | `dt.custom_tags` |
Network zones | :warning: | `dt.network_zones` |
OneAgents - Remote configuration | :heavy_check_mark: | `dt.oneagents_remote_configuration` |
Problems | :heavy_check_mark: | `dt.problems` |
Security problems | :x: | |
Service-level objectives | :heavy_check_mark: | `dt.slos` |
Expand Down
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[tool.poetry]
name = "dt"
version = "1.1.71"
description = "Dynatrace API Python client"
readme = "README.md"
authors = ["David Lopes <davidribeirolopes@gmail.com>"]
maintainers = [
"David Lopes <davidribeirolopes@gmail.com>",
"James Kitson <james.kitson@dynatrace.com>",
"Vagiz Duseev <vagiz@duseev.com>"
]
homepage = "https://github.com/dynatrace-oss/api-client-python"
repository = "https://github.com/dynatrace-oss/api-client-python"
documentation = "https://github.com/dynatrace-oss/api-client-python"
packages = [
{ include = "dynatrace*" }
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Topic :: Software Development",
]

[tool.poetry.dependencies]
python = ">=3.6"
requests = ">=2.22"

[tool.poetry.group.dev.dependencies]
pytest = "*"
mock = "*"
tox = "*"
wrapt = "*"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements_dev.txt

This file was deleted.

37 changes: 0 additions & 37 deletions setup.py

This file was deleted.

Loading