Skip to content

Commit e1afc17

Browse files
committed
package setup
1 parent 638650b commit e1afc17

14 files changed

+439
-3
lines changed

.github/pull_request_template.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
### Scope of changes
2+
3+
[Brief Description of the Changes]
4+
5+
Fixes SC-XXXXX
6+
7+
### Type of change
8+
9+
- [ ] new feature
10+
- [ ] bug fix
11+
- [ ] documentation
12+
- [ ] testing
13+
- [ ] technical debt
14+
- [ ] other (describe)
15+
16+
### Acceptance criteria
17+
18+
[Copy acceptance criteria checklist from story for reviewer, or add a brief acceptance criteria here]
19+
20+
### Definition of Done
21+
22+
- [ ] I have manually tested the change running it locally (having rebuilt all containers) or via unit tests
23+
- [ ] I have added unit and/or integration tests that cover my changes
24+
- [ ] I have added new test fixtures as needed to support added tests
25+
- [ ] I have updated the dependencies list if necessary (including updating yarn.lock and/or go.sum)
26+
- [ ] I have recompiled and included new protocol buffers to reflect changes I made if necessary
27+
- [ ] Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
28+
- [ ] I have notified the reviewer via Shortcut or Slack that this is ready for review
29+
- [ ] Documented service configuration changes or created related devops stories
30+
31+
### Reviewer(s) checklist
32+
33+
- [ ] Any new user-facing content that has been added for this PR has been QA'ed to ensure correct grammar, spelling, and understandability.
34+
- [ ] Are there any TODOs in this PR that should be turned into stories?

.github/workflows/build.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build Package Distribution
2+
on:
3+
push:
4+
tags:
5+
- "v*"
6+
7+
jobs:
8+
build:
9+
name: Build Distributions
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Python 3.12
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.12.x"
19+
20+
- name: Install Dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install setuptools wheel
24+
25+
- name: Build Distribution
26+
run: |
27+
python setup.py sdist bdist_wheel

.github/workflows/publish.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish PyPI Packages
2+
on:
3+
release:
4+
types: [published]
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
name: Build Distributions
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Python 3.12
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.12.x"
21+
22+
- name: Install Dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install setuptools wheel
26+
27+
- name: Build Distribution
28+
run: |
29+
python setup.py sdist bdist_wheel

.github/workflows/tests.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- "v*"
7+
pull_request:
8+
9+
jobs:
10+
pytest:
11+
name: Unit Tests
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: ${{ github.workspace }}/pyhonu
16+
strategy:
17+
matrix:
18+
python-version: ["3.10.x", "3.11.x", "3.12.x"]
19+
20+
steps:
21+
- name: Checkout Code
22+
uses: actions/checkout@v4
23+
with:
24+
path: ${{ github.workspace }}/pyhonu
25+
26+
- name: Setup Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install Dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install -r requirements.txt
35+
pip install -r tests/requirements.txt
36+
37+
- name: Run Tests
38+
run: pytest

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2024, Rotational
3+
Copyright (c) 2024, Rotational Labs, Inc.
44

55
Redistribution and use in source and binary forms, with or without
66
modification, are permitted provided that the following conditions are met:

MANIFEST.in

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
include *.md
2+
include *.rst
3+
include *.txt
4+
include *.yml
5+
include *.cfg
6+
include MANIFEST.in
7+
8+
include LICENSE.txt
9+
10+
graft docs
11+
prune docs/_build
12+
13+
graft tests
14+
prune tests/fixtures
15+
16+
graft honu
17+
18+
global-exclude __pycache__
19+
global-exclude *.py[co]
20+
global-exclude .ipynb_checkpoints
21+
global-exclude .DS_Store
22+
global-exclude .env
23+
global-exclude .coverage.*

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# pyhonu
2-
Python driver and api client for HonuDB
1+
# Honu Python Drivers
2+
3+
**Python driver and API client for the Honu replicated database.**

honu/__init__.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
A Python API client and database driver to interact with Honu replicas. The Honu
3+
database is a scalable geographic distributed data store that uses smart anti-entropy
4+
replication to maintain consistency across multiple replicas. The HonuDB is intended
5+
to store documents and vectors for AI/ML workloads.
6+
"""
7+
8+
##########################################################################
9+
## Module Info
10+
##########################################################################
11+
12+
# Import the version number at the top level
13+
from .version import get_version, __version_info__
14+
15+
16+
##########################################################################
17+
## Package Version
18+
##########################################################################
19+
20+
__version__ = get_version(short=True)

honu/version.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""
2+
Defines module and package information for honu, specifically the version.
3+
"""
4+
5+
# Module version and package information
6+
__version_info__ = {
7+
"major": 0,
8+
"minor": 1,
9+
"micro": 0,
10+
"releaselevel": "alpha",
11+
"post": 0,
12+
"serial": 1,
13+
}
14+
15+
16+
def get_version(short: bool = False) -> str:
17+
"""
18+
Prints the version.
19+
"""
20+
assert __version_info__["releaselevel"] in ("alpha", "beta", "final")
21+
vers = ["{major}.{minor}".format(**__version_info__)]
22+
23+
if __version_info__["micro"]:
24+
vers.append(".{micro}".format(**__version_info__))
25+
26+
if __version_info__["releaselevel"] != "final" and not short:
27+
vers.append(
28+
"{}{}".format(
29+
__version_info__["releaselevel"][0],
30+
__version_info__["serial"],
31+
)
32+
)
33+
34+
if __version_info__["post"]:
35+
vers.append(".post{}".format(__version_info__["post"]))
36+
37+
return "".join(vers)

requirements.txt

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Primary Dependencies
2+
3+
# Packaging Dependencies
4+
# black==24.8.0
5+
# pip==24.2
6+
# setuptools==72.2.0
7+
# twine==5.1.1
8+
# wheel==0.44.0
9+
10+
# Testing Dependencies
11+
# pytest==8.3.2
12+
# coverage==7.6.1
13+
# pyflakes==3.2.0
14+
# pytest-cov==5.0.0
15+
# pytest-flakes==4.0.5
16+
# pytest-spec==4.0.0
17+
18+
# Subdependencies
19+
# certifi==2024.8.30
20+
# charset-normalizer==3.4.0
21+
# click==8.1.7
22+
# docutils==0.21.2
23+
# idna==3.10
24+
# importlib_metadata==8.5.0
25+
# iniconfig==2.0.0
26+
# jaraco.classes==3.4.0
27+
# jaraco.context==6.0.1
28+
# jaraco.functools==4.1.0
29+
# keyring==25.5.0
30+
# markdown-it-py==3.0.0
31+
# mdurl==0.1.2
32+
# more-itertools==10.5.0
33+
# mypy-extensions==1.0.0
34+
# nh3==0.2.18
35+
# packaging==24.2
36+
# pathspec==0.12.1
37+
# pkginfo==1.10.0
38+
# platformdirs==4.3.6
39+
# pluggy==1.5.0
40+
# Pygments==2.18.0
41+
# readme_renderer==44.0
42+
# requests-toolbelt==1.0.0
43+
# requests==2.32.3
44+
# rfc3986==2.0.0
45+
# rich==13.9.4
46+
# urllib3==2.2.3
47+
# zipp==3.21.0

setup.cfg

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[metadata]
2+
description-file = README.md
3+
license_file = LICENSE
4+
5+
[test]
6+
tests = True
7+
8+
[aliases]
9+
test=pytest
10+
11+
[tool:pytest]
12+
addopts = --verbose --cov=honu --flakes --spec --cov-report=xml --cov-report term
13+
python_files = tests/*
14+
flakes-ignore =
15+
__init__.py UnusedImport
16+
__init__.py ImportStarUsed
17+
test_*.py ImportStarUsed
18+
test_*.py ImportStarUsage
19+
conftest.py UnusedVariable
20+
examples/* ALL
21+
tests/checks.py ALL
22+
docs/_build ALL
23+
spec_header_format = {class_name} ({path})
24+
filterwarnings =
25+
once::UserWarning
26+
once::DeprecationWarning
27+
once::PendingDeprecationWarning
28+
ignore::FutureWarning
29+
30+
[flake8]
31+
# match black maximum line length
32+
max-line-length = 88
33+
extend-ignore = E203,E266
34+
per-file-ignores =
35+
__init__.py:F401
36+
test_*.py:F405,F403
37+
conftest.py:F841
38+
setup.py:E221

0 commit comments

Comments
 (0)