Skip to content
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
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
# From https://github.com/4teamwork/ftw-buildouts/blob/master/pycodestyle.cfg
ignore = E121,E122,E123,E125,E126,E127,E128,E203,E301,W503,W606
max-line-length = 125
exclude = .git,__pycache__,venv,.tox,manage.py,include,lib,javascript,lib,node_modules,scss,bin,.eggs,wsgi.py,wsgi.py,src,migrations,docs,gever,bootstrap.py
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Description




Belongs to PBI [TI-xxx].

## Checklist

The following checklist should help us to stick to our "definition of done":

- [ ] Proposed changes include tests.
- [ ] Good error handling with useful messages
- [ ] Changelog added
- [ ] Readme has been updated if changes interfere with the setup process.
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Linting

on:
- push

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.13
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 2.1
- name: Install dependencies
run: poetry install
- name: isort
run: poetry run isort --check-only --quiet --settings pyproject.toml .
- name: flake8
run: poetry run flake8
- name: black
run: poetry run black --check --config pyproject.toml .
Empty file added CHANGELOG.md
Empty file.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# We don't release this package. This dummy MANIFEST.in stops zest.releaser
# from complaining.
7 changes: 7 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

set -euo pipefail

git pull
poetry run fullrelease
poetry publish --build
1 change: 1 addition & 0 deletions changes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
1 change: 1 addition & 0 deletions changes/TI-3219.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modernise the GitHub Repository and add the lexwork client to pip. (`TI-3219 <https://4teamwork.atlassian.net/browse/TI-3219>`_)
2 changes: 2 additions & 0 deletions lexwork/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__all__ = ["APIClient"]

from .client import APIClient
4 changes: 3 additions & 1 deletion lexwork/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def sign_pdf(self, file_like, reason, file_name=None):
return response.json().get("result", {"signed_data": ""}).get("signed_data")

def _make_request(self, path, method="get", **kwargs):
response = getattr(self.session, method)(urljoin(self.url, self.base_api_path, path), **kwargs)
response = getattr(self.session, method)(
urljoin(self.url, self.base_api_path, path), **kwargs
)
response.raise_for_status()
return response
1,395 changes: 1,395 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[tool.poetry]
name = "ftw-lexwork"
version = "2025.1.0"
description = "API Client for Lexwork PDF Signer."
authors = ["4teamwork AG"]
readme = "README.rst"
packages = [{include = "lexwork"}]

[tool.poetry.dependencies]
python = ">=3.12, <4"
requests = "^2"
urllib3 = "^2"

[tool.poetry.group.dev.dependencies]
black = "^25.1.0"
isort = "^6.0.1"
flake8 = "7.3.0"
mypy = "^1.17.1"
towncrier = "^25.8.0"
zest-releaser = "^9.6.2"
zestreleaser-towncrier = "^1.3.0"

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

[tool.black]
exclude = '''
(
/(
\.git
| \.venv
| \.eggs
)/
)
'''

[tool.isort]
force_alphabetical_sort_within_sections = true
force_single_line = true
from_first = false
line_length = 200
known_first_party = "lexwork"
lines_after_imports = 2
skip_glob = ".venv,.eggs"

[tool.towncrier]
package = "lexwork"
directory = "changes"
template = "towncrier.md"
filename = "CHANGELOG.md"
underlines = ["-", ""]

[[tool.towncrier.type]]
directory = "feature"
name = "New features:"
showcontent = true

[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug fixes:"
showcontent = true

[[tool.towncrier.type]]
directory = "other"
name = "Other changes:"
showcontent = true

[tool.mypy]
follow_imports = "skip"
strict = true
ignore_missing_imports = true
warn_return_any = false
warn_unused_ignores = true
disallow_untyped_defs = true
disallow_any_unimported = false
disallow_subclassing_any = false
disallow_untyped_decorators = false
disallow_any_generics = false
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[zest.releaser]
release = no
history-file = CHANGELOG.md
push-changes = yes
23 changes: 0 additions & 23 deletions setup.py

This file was deleted.

35 changes: 35 additions & 0 deletions towncrier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

{{ versiondata.version }} ({{ versiondata.date }})
{{ top_underline * ((versiondata.version + versiondata.date)|length + 3)}}
{% for section, _ in sections.items() %}
{% set underline = underlines[0] %}{% if section %}{{section}}
{{ underline * section|length }}{% set underline = underlines[1] %}

{% endif %}

{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section]%}
{{ definitions[category]['name'] }}
{{ underline * definitions[category]['name']|length }}
{% if definitions[category]['showcontent'] %}
{% for text in sections[section][category].keys()|sort %}
- {{ text }}
{% endfor %}

{% else %}
- {{ sections[section][category]['']|join(', ') }}

{% endif %}
{% if sections[section][category]|length == 0 %}
No changes.

{% else %}
{% endif %}

{% endfor %}
{% else %}
No changes.


{% endif %}
{% endfor %}
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025.1.0.dev0