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
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
- name: Install Poetry
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest pytest-django pytest-cov
curl -sSL https://install.python-poetry.org | python3 -
poetry --version

- name: Install dependencies
run: poetry install

- name: Run tests and collect coverage
run: |
pytest --maxfail=1 --disable-warnings -q --cov=entities --cov-report=xml:coverage.xml --cov-report=html:coverage_html
run: poetry run pytest --maxfail=1 --disable-warnings -q --cov=entities --cov-report=xml:coverage.xml --cov-report=html:coverage_html

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/.venv
/poetry.lock
/inventory_api/__pycache__/
/tests/__pycache__/
*.pyc
.DS_Store
.env
db.sqlite3
.coverage
coverage.xml
coverage.xml
coverage_html/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ source .venv/bin/activate

### 2. Install dependencies
```bash
pip install -r requirements.txt
poetry install
```

### 3. Apply migrations
Expand Down
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[tool.poetry]
name = "inventory-api"
version = "0.1.0"
description = "A simple RESTful API for managing Entity records, built with Django and Django Ninja"
authors = ["Your Name <your.email@example.com>"]
readme = "README.md"
packages = [{include = "inventory_api"}, {include = "entities"}]

[tool.poetry.dependencies]
python = "^3.11"
Django = "^6.0.1"
django-ninja = "^1.5.3"
django-cors-headers = "^4.0.0"
pydantic = "^2.12.5"
uvicorn = "^0.40.0"
asgiref = "^3.11.0"
h11 = "^0.16.0"
click = "^8.3.1"
sqlparse = "^0.5.5"
typing-extensions = "^4.15.0"
annotated-types = "^0.7.0"
pydantic-core = "^2.41.5"

[tool.poetry.group.dev.dependencies]
pytest = "^9.0.2"
pytest-django = "^4.11.1"
pytest-cov = "^7.0.0"
coverage = "^7.13.1"
typing-inspection = "^0.4.2"
Pygments = "^2.19.2"
iniconfig = "^2.3.0"
packaging = "^25.0"
pluggy = "^1.6.0"

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

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "inventory_api.settings"
testpaths = ["tests"]
python_files = ["tests.py", "test_*.py", "*_tests.py"]

[tool.coverage.run]
source = ["entities"]
branch = true

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
]
21 changes: 0 additions & 21 deletions requirements.txt

This file was deleted.

Loading