Skip to content

Commit fde45e2

Browse files
authored
Merge pull request #106 from vduseev/main
Migrate to Poetry
2 parents 63149fb + f23996c commit fde45e2

13 files changed

+90
-62
lines changed

Diff for: .github/workflows/publish.yml

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
name: Build and publish to PyPi
2-
on: push
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
description: 'Tag to publish (v*.*.*)'
7+
required: true
8+
type: string
39

410
jobs:
511
build-n-publish:
612
name: Build and publish to PyPi
713
runs-on: ubuntu-20.04
814
steps:
9-
- uses: actions/checkout@master
10-
- uses: actions/setup-python@v2
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ inputs.tag }}
18+
- uses: actions/setup-python@v5
1119
- name: Install dependencies
1220
run: |
13-
python -m pip install --upgrade setuptools wheel
21+
python -m pip install --upgrade poetry
22+
poetry install
1423
- name: Build
1524
run: |
16-
python setup.py sdist bdist_wheel
25+
poetry build
26+
- name: Configure Poetry credentials
27+
run: |
28+
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
1729
- name: Publish
18-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
19-
uses: pypa/gh-action-pypi-publish@release/v1
20-
with:
21-
user: __token__
22-
password: ${{ secrets.PYPI_API_TOKEN }}
30+
run: |
31+
poetry publish

Diff for: .github/workflows/tests.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ jobs:
1010
matrix:
1111
# https://help.github.com/articles/virtual-environments-for-github-actions
1212
platform:
13-
- ubuntu-20.04 # ubuntu-20.04
14-
- macos-latest # macOS-10.14
15-
- windows-latest # windows-2019
16-
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ]
13+
- ubuntu-20.04
14+
- macos-latest
15+
- windows-latest
16+
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
17+
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
1718
exclude:
1819
- platform: macos-latest
1920
python-version: '3.6'
2021
- platform: macos-latest
2122
python-version: '3.7'
2223

2324
steps:
24-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2526
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v5
2728
with:
2829
python-version: ${{ matrix.python-version }}
2930
- name: Install dependencies

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ ipython_config.py
9999
# This is especially recommended for binary packages to ensure reproducibility, and is more
100100
# commonly ignored for libraries.
101101
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102-
#poetry.lock
102+
poetry.lock
103103

104104
# pdm
105105
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.

Diff for: CONTRIBUTING.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ To contribute, [fork](https://www.dynatrace.com/support/help/dynatrace-api) this
77
[Tests](#tests)
88
[Code formatting](#code-formatting)
99

10-
1110
<a name="setup"/>
1211

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

31+
You need Poetry on your system to be able to build and release the package.
32+
If you don't have a system-wide installation of Poetry, you can install it
33+
in the same virtual environment.
34+
35+
```shell
36+
pip install poetry
37+
```
38+
3239
Install the dev requirements:
3340

3441
```shell
35-
pip install -r requirements_dev.txt
42+
poetry install
3643
```
3744

3845
Make sure tests pass:

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ dt.settings.create_object(validate_only=False, body=settings_object)
145145
ActiveGates | :heavy_check_mark: | `dt.activegates` |
146146
ActiveGates - Auto-update configuration | :heavy_check_mark: | `dt.activegates_autoupdate_configuration` |
147147
ActiveGates - Auto-update jobs | :heavy_check_mark: | `dt.activegates_autoupdate_jobs` |
148+
ActiveGates - Remote configuration | :heavy_check_mark: | `dt.activegates_remote_configuration` |
148149
Audit Logs | :heavy_check_mark: | `dt.audit_logs` |
149150
Events | :warning: | `dt.events_v2` |
150151
Extensions 2.0 | :heavy_check_mark: | `dt.extensions_v2` |
@@ -153,6 +154,7 @@ dt.settings.create_object(validate_only=False, body=settings_object)
153154
Monitored entities | :warning: | `dt.entities` |
154155
Monitored entities - Custom tags | :heavy_check_mark: | `dt.custom_tags` |
155156
Network zones | :warning: | `dt.network_zones` |
157+
OneAgents - Remote configuration | :heavy_check_mark: | `dt.oneagents_remote_configuration` |
156158
Problems | :heavy_check_mark: | `dt.problems` |
157159
Security problems | :x: | |
158160
Service-level objectives | :heavy_check_mark: | `dt.slos` |

Diff for: pyproject.toml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[tool.poetry]
2+
name = "dt"
3+
version = "1.1.71"
4+
description = "Dynatrace API Python client"
5+
readme = "README.md"
6+
authors = ["David Lopes <[email protected]>"]
7+
maintainers = [
8+
"David Lopes <[email protected]>",
9+
"James Kitson <[email protected]>",
10+
"Vagiz Duseev <[email protected]>"
11+
]
12+
homepage = "https://github.com/dynatrace-oss/api-client-python"
13+
repository = "https://github.com/dynatrace-oss/api-client-python"
14+
documentation = "https://github.com/dynatrace-oss/api-client-python"
15+
packages = [
16+
{ include = "dynatrace*" }
17+
]
18+
classifiers = [
19+
"Development Status :: 5 - Production/Stable",
20+
"Intended Audience :: Developers",
21+
"License :: OSI Approved",
22+
"License :: OSI Approved :: Apache Software License",
23+
"Programming Language :: Python",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3.6",
26+
"Programming Language :: Python :: 3.7",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
33+
"Programming Language :: Python :: Implementation :: CPython",
34+
"Operating System :: POSIX :: Linux",
35+
"Operating System :: Microsoft :: Windows",
36+
"Operating System :: MacOS",
37+
"Topic :: Software Development",
38+
]
39+
40+
[tool.poetry.dependencies]
41+
python = ">=3.6"
42+
requests = ">=2.22"
43+
44+
[tool.poetry.group.dev.dependencies]
45+
pytest = "*"
46+
mock = "*"
47+
tox = "*"
48+
wrapt = "*"
49+
50+
[build-system]
51+
requires = ["poetry-core"]
52+
build-backend = "poetry.core.masonry.api"

Diff for: requirements.txt

-1
This file was deleted.

Diff for: requirements_dev.txt

-5
This file was deleted.

Diff for: setup.py

-37
This file was deleted.

0 commit comments

Comments
 (0)