Skip to content

Commit

Permalink
feat: migrate to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
neubi4 committed Nov 21, 2024
1 parent 705174e commit 22da63e
Show file tree
Hide file tree
Showing 19 changed files with 1,623 additions and 464 deletions.
68 changes: 29 additions & 39 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,36 @@
name: octoDNS AutoDNSProvider
on: [pull_request, workflow_dispatch]
---
name: tests

on:
push:
pull_request:

jobs:
config:
runs-on: ubuntu-latest
outputs:
json: ${{ steps.load.outputs.json }}
steps:
- id: load
run: |
{
echo 'json<<EOF'
curl -L https://github.com/octodns/octodns/raw/main/.ci-config.json
echo EOF
} >> $GITHUB_OUTPUT
ci:
needs: config
tests:
name: Run tests (py${{ matrix.python }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(needs.config.outputs.json).python_versions_active }}
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: CI Build
run: |
./script/cibuild
setup-py:
needs: config
runs-on: ubuntu-latest
python:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ fromJson(needs.config.outputs.json).python_version_current }}
architecture: x64
- name: CI setup.py
run: |
./script/cibuild-setup-py
python-version: ${{ matrix.python }}

- name: Install poetry
run: pip install poetry

- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run tox
13 changes: 0 additions & 13 deletions .github/workflows/stale.yml

This file was deleted.

14 changes: 8 additions & 6 deletions octodns_autodns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@
# TODO: remove __VERSION__ with the next major version release
__version__ = __VERSION__ = '0.0.1'


class AutoDNSClientException(ProviderException):
pass


class AutoDNSClientNotFound(AutoDNSClientException):
def __init__(self):
super().__init__('Not Found')


class AutoDNSClientUnauthorized(AutoDNSClientException):
def __init__(self):
super().__init__('Unauthorized')


class AutoDNSClient(object):
BASE_URL = 'https://api.autodns.com/v1'

Expand Down Expand Up @@ -64,8 +68,8 @@ def zone_update_records(self, zone_name: str, records_add: list[dict], records_r

class AutoDNSProvider(BaseProvider):
SUPPORTS_GEO = False
#SUPPORTS_DYNAMIC = False
#SUPPORTS_ROOT_NS = True
# SUPPORTS_DYNAMIC = False
# SUPPORTS_ROOT_NS = True
SUPPORTS = set(
(
'A',
Expand All @@ -79,7 +83,7 @@ class AutoDNSProvider(BaseProvider):
'MX',
'NS',
'SRV',
'ALIAS'
'ALIAS',
)
)

Expand All @@ -101,9 +105,7 @@ def __init__(
self.id = id

sess = Session()
sess.headers.update({
"X-Domainrobot-Context": str(context),
})
sess.headers.update({"X-Domainrobot-Context": str(context)})
sess.auth = HTTPBasicAuth(username, password)

self.client = AutoDNSClient(sess, system_name_servers[0])
Expand Down
1,463 changes: 1,463 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
[tool.poetry]
name = "octodns-autodns"
version = "0.0.1"
description = " octodns Provider for AutoDNS by InternetX "
readme = "README.md"
authors = [
"Christoph Sieber <[email protected]>",
"Christopher Grau <[email protected]>",
"Benjamin Böhm <[email protected]>",
"Martin Neubert <[email protected]>",
]
license = "MIT"
homepage = "https://github.com/telekom-mms/octodns-autodns"
repository = "https://github.com/telekom-mms/octodns-autodns"
documentation = "https://github.com/telekom-mms/octodns-autodns"
keywords = ["octodns", "autodns", "internetx", "dns"]

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
pyyaml = "6.0.2"
dnspython = "2.7.0"
fqdn = "1.5.1"
idna = "3.10"
natsort = "8.4.0"
octodns = "1.10.0"
python-dateutil = "2.9.0.post0"
six = "1.16.0"

[tool.poetry.group.dev.dependencies]
pygments = "2.18.0"
black = "24.10.0"
build = "1.2.2.post1"
certifi = "2024.8.30"
cffi = "1.17.1"
charset-normalizer = "3.3.2"
click = "8.1.7"
cmarkgfm = "2024.1.14"
coverage = "7.6.1"
docutils = "0.20.1"
importlib-metadata = "8.5.0"
iniconfig = "2.0.0"
isort = "5.13.2"
jaraco-classes = "3.4.0"
jaraco-context = "6.0.1"
jaraco-functools = "4.1.0"
keyring = "25.4.1"
markdown-it-py = "3.0.0"
mdurl = "0.1.2"
more-itertools = "10.5.0"
mypy-extensions = "1.0.0"
nh3 = "0.2.18"
packaging = "24.1"
pathspec = "0.12.1"
pkginfo = "1.10.0"
platformdirs = "4.3.6"
pluggy = "1.5.0"
pycparser = "2.22"
pyflakes = "3.2.0"
pyproject-hooks = "1.2.0"
pytest-cov = "5.0.0"
pytest = "8.3.3"
pytest-network = "0.0.1"
readme-renderer = "43.0"
requests-toolbelt = "1.0.0"
requests = "2.32.3"
rfc3986 = "2.0.0"
rich = "13.9.2"
twine = "5.1.1"
urllib3 = "2.2.3"
zipp = "3.20.2"
tox = "^4.21.2"
flake8 = "^7.1.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length=80
skip-string-normalization=true
Expand Down
14 changes: 14 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"dependencyDashboard": true,
"dependencyDashboardAutoclose": true,
"packageRules": [
{
"matchUpdateTypes": ["patch", "minor"],
"automerge": true
}
]
}
42 changes: 0 additions & 42 deletions requirements-dev.txt

This file was deleted.

10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

48 changes: 0 additions & 48 deletions script/bootstrap

This file was deleted.

31 changes: 0 additions & 31 deletions script/cibuild

This file was deleted.

23 changes: 0 additions & 23 deletions script/cibuild-setup-py

This file was deleted.

Loading

0 comments on commit 22da63e

Please sign in to comment.