Skip to content

Commit db58e4a

Browse files
committed
Kick-start NetLicensing python client library
1 parent d9de780 commit db58e4a

46 files changed

Lines changed: 3870 additions & 348 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 20 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,39 @@
1-
# Byte-compiled / optimized / DLL files
1+
# ── Python ────────────────────────────────────────────────────────────────────
22
__pycache__/
33
*.py[cod]
4+
*.pyo
45
*$py.class
5-
6-
# C extensions
76
*.so
87

9-
# Distribution / packaging
10-
.Python
8+
# ── Build & packaging ─────────────────────────────────────────────────────────
119
build/
12-
develop-eggs/
1310
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
pip-wheel-metadata/
24-
share/python-wheels/
2511
*.egg-info/
26-
.installed.cfg
2712
*.egg
28-
MANIFEST
29-
30-
# PyInstaller
31-
# Usually these files are written by a python script from a template
32-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33-
*.manifest
34-
*.spec
3513

36-
# Installer logs
37-
pip-log.txt
38-
pip-delete-this-directory.txt
14+
# ── Virtual environments ──────────────────────────────────────────────────────
15+
.env
16+
.venv/
17+
venv/
3918

40-
# Unit test / coverage reports
41-
htmlcov/
42-
.tox/
43-
.nox/
19+
# ── Testing & coverage ────────────────────────────────────────────────────────
4420
.coverage
4521
.coverage.*
46-
.cache
47-
nosetests.xml
4822
coverage.xml
49-
*.cover
50-
*.py,cover
51-
.hypothesis/
23+
htmlcov/
5224
.pytest_cache/
25+
.tox/
26+
.nox/
5327

54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
target/
76-
77-
# Jupyter Notebook
78-
.ipynb_checkpoints
79-
80-
# IPython
81-
profile_default/
82-
ipython_config.py
83-
84-
# pyenv
85-
.python-version
86-
87-
# pipenv
88-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91-
# install all needed dependencies.
92-
#Pipfile.lock
93-
94-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95-
__pypackages__/
96-
97-
# Celery stuff
98-
celerybeat-schedule
99-
celerybeat.pid
100-
101-
# SageMath parsed files
102-
*.sage.py
103-
104-
# Environments
105-
.env
106-
.venv
107-
env/
108-
venv/
109-
ENV/
110-
env.bak/
111-
venv.bak/
112-
113-
# Spyder project settings
114-
.spyderproject
115-
.spyproject
116-
117-
# Rope project settings
118-
.ropeproject
119-
120-
# mkdocs documentation
121-
/site
122-
123-
# mypy
28+
# ── Type checkers ─────────────────────────────────────────────────────────────
12429
.mypy_cache/
12530
.dmypy.json
126-
dmypy.json
127-
128-
# Pyre type checker
12931
.pyre/
130-
.vscode
32+
33+
# ── IDE / editor ──────────────────────────────────────────────────────────────
34+
.idea/
35+
.vscode/
36+
37+
# ── OS artefacts ──────────────────────────────────────────────────────────────
38+
.DS_Store
39+
Thumbs.db

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
3+
## 0.1.0
4+
5+
- Rebuilt the package around a `src/` layout and `pyproject.toml` packaging.
6+
- Added `httpx`-based `NetLicensingClient` with API-key and username/password authentication.
7+
- Added typed Pydantic models for core NetLicensing entities.
8+
- Added services for products, product modules, licensees, license templates, licenses, tokens, transactions, payment methods, bundles, notifications, utility data, and validation.
9+
- Added deterministic pytest coverage using `httpx.MockTransport`.
10+
- Added demo CLI for validation and shop-token flows.

CONTRIBUTING.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,56 @@
1111
* Ensure tests are passing
1212
* Ensure branch is mergeable
1313

14+
## Setup
15+
16+
```bash
17+
pip install -e ".[dev]"
18+
```
19+
1420
## Test
1521

1622
Testing is set up using [pytest](http://pytest.org) and coverage is handled with the pytest-cov plugin.
1723

18-
Run your tests with ```py.test``` in the root directory and please make sure all tests pass.
24+
Run your tests with:
25+
26+
```bash
27+
pytest
28+
```
29+
30+
Coverage is reported in the terminal after each run.
31+
To view a detailed HTML report open `htmlcov/index.html` after running the tests.
1932

20-
Coverage is ran by default and is set in the ```pytest.ini``` file.
21-
To see an html output of coverage open ```htmlcov/index.html``` after running the tests.
33+
To run the optional live integration tests against the NetLicensing demo account:
34+
35+
```bash
36+
NETLICENSING_LIVE_DEMO=1 pytest tests/test_live_demo.py -q
37+
```
38+
39+
## Type checking
40+
41+
```bash
42+
mypy src/netlicensing
43+
```
2244

2345
## Release
2446

25-
Install [Twine](https://twine.readthedocs.io):
47+
Create a source distribution and wheel:
2648

2749
```bash
28-
pip install twine
50+
python -m build
2951
```
3052

31-
Create distributions:
53+
Verify the distribution before uploading:
3254

3355
```bash
34-
python setup.py sdist bdist_wheel
56+
twine check dist/*
3557
```
3658

37-
Upload to TestPyPI/PyPI:
59+
Upload to TestPyPI first, then PyPI:
3860

3961
```bash
40-
# Test PyPi
62+
# Test PyPI
4163
twine upload -r testpypi dist/*
42-
# PyPi
64+
# PyPI
4365
twine upload dist/*
4466
```

0 commit comments

Comments
 (0)