Skip to content

Commit cc4a272

Browse files
authored
Merge pull request #13 from f-klubben/feat/package
Add pyproject.toml
2 parents ef9a10c + b8d6bce commit cc4a272

File tree

10 files changed

+84
-2
lines changed

10 files changed

+84
-2
lines changed

.github/workflows/black.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
- name: Black Code Formatter
1515
uses: lgeiger/[email protected]
1616
with:
17-
args: --check --target-version py312 --line-length 120 --skip-string-normalization *.py
17+
args: --check --target-version py312 --line-length 120 --skip-string-normalization src tests

.github/workflows/django.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
python -m pip install --upgrade pip
2828
pip install -r requirements.txt
2929
pip install coverage # Explicitly install coverage
30+
pip install . # Install self locally for pytest
3031
- name: Run Tests
3132
run: |
3233
coverage run --source=. -m pytest

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.pyc
2+
*.pyo
3+
/dist
4+
/build
5+
/ez_setup.py
6+
/*.egg-info

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
11
# Vipps Report API
22

33
This is the Vipps-MobilePay accounting API implementation from f-klubben/stregsystemet. This is an experiment to fully type the implementation to make it more robust.
4+
5+
## Development
6+
7+
### Tests
8+
9+
Install pytest in your environment: `pip install pytest`
10+
11+
12+
To make Pytest successfully import the library, it has to be installed locally in editable mode.
13+
14+
`pip install --editable .`
15+
16+
17+
You should now be able to run Pytest
18+
19+
`pytest` (for some installations you may need to explicitly lookup the module `python -m pytest`)
20+
21+
22+
### Typechecking
23+
24+
Static analysis is done using Mypy.
25+
26+
Install mypy in your environment `pip install mypy`
27+
28+
29+
You should simply be anble to run Mypy
30+
31+
`mypy .` (might need explicit invocation `python -m mypy`)

pyproject.toml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "vipps-api"
7+
description = "An implementation of Vipps-MobilePay API (Supports Report API)"
8+
readme = "README.md"
9+
license = { file = "LICENSE" }
10+
version = "0.1.0"
11+
12+
maintainers = [
13+
{ name = "F-Klubben", email = "[email protected]" }
14+
]
15+
16+
authors = [
17+
{ name = "Falke Carlsen" },
18+
{ name = "Kresten Laust", email = "[email protected]" },
19+
{ name = "Jonas B. Andersen" },
20+
{ name = "Bo Andersen" },
21+
{ name = "Asger Weirsøe" },
22+
]
23+
24+
classifiers = [
25+
"Development Status :: 3 - Alpha",
26+
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"Programming Language :: Python :: 3.12",
30+
"Programming Language :: Python :: 3.13",
31+
"Programming Language :: Python :: 3 :: Only",
32+
"Operating System :: OS Independent",
33+
]
34+
35+
requires-python = ">= 3.10"
36+
37+
dependencies = [
38+
"Django>=2.2",
39+
"requests>=2.24.0"
40+
]
41+
42+
[project.urls]
43+
Homepage = "https://github.com/f-klubben/vipps_api"
44+
Repository = "https://github.com/f-klubben/vipps_api.git"
45+
Issues = "https://github.com/f-klubben/vipps_api/issues"

src/vipps_api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.1.0"
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import pytest
22
from pathlib import Path
3-
from vipps_api import *
43

54
from unittest.mock import patch
65
from http import HTTPStatus
76

7+
from vipps_api.accounting import *
8+
89

910
@pytest.fixture
1011
def mock_ledger_info_response():

0 commit comments

Comments
 (0)