Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize Package #1

Merged
merged 17 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
39 changes: 39 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run Unit Tests

on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
types:
- ready_for_review
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
integration:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.12.x'
architecture: 'x64'

- name: Install Dependencies
run: pdm install
working-directory: ./

- name: Run E2E Tests
kraftp marked this conversation as resolved.
Show resolved Hide resolved
run: pdm run pytest -s tests
working-directory: ./

21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
# dbos-python
# DBOS Transact Python

This package uses [`pdm`](https://pdm-project.org/en/latest/) for package and virtual environment management.
To install `pdm`, run:

```
curl -sSL https://pdm-project.org/install-pdm.py | python3 -
```

To install dependencies:

```
pdm install
```

To run unit tests:

```
pdm run pytest -s tests
```
Empty file added dbos_transact/__init__.py
kraftp marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
9 changes: 9 additions & 0 deletions dbos_transact/dbos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import logging

class DBOS:
def __init__(self):
logger = logging.getLogger("dbos")
logger.info("Initializing DBOS!")

def example(self):
return 0
75 changes: 75 additions & 0 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[project]
name = "dbos_transact"
version = "0.1.0"
description = "A Python framework for backends that scale"
authors = [
{name = "DBOS, Inc.", email = "[email protected]"},
]
dependencies = [
"pytest>=8.2.2",
kraftp marked this conversation as resolved.
Show resolved Hide resolved
]
requires-python = ">=3.12"
readme = "README.md"
license = {text = "MIT"}

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.pdm]
distribution = true
Empty file added tests/__init__.py
Empty file.
Empty file added tests/conftest.py
Empty file.
4 changes: 4 additions & 0 deletions tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
log_cli_format = %(asctime)s [%(levelname)8s] (%(filename)s:%(lineno)s) %(message)s
log_cli_level = INFO
log_cli = true
5 changes: 5 additions & 0 deletions tests/test_dbos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbos_transact.dbos import DBOS

def test_dbos():
dbos = DBOS()
assert dbos.example() == 0