Skip to content

Commit

Permalink
Add linting to pyproject.toml (#1)
Browse files Browse the repository at this point in the history
* Add linting to pyproject.toml

* Fix pipeline

* Fix pipeline

* Modify pyproject

* add tests

* Add test init

* Fix ruff

* Add dummy test

* Fix linting

* Change cache key to pyproject.toml hash

* remove matrix tox-env

* Add dummy dockerfile

---------

Co-authored-by: Nicolas Frank <nicolas.frank@epfl.ch>
  • Loading branch information
WonderPG and Nicolas Frank authored Sep 11, 2024
1 parent e8420ac commit 1a260b7
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ matrix.tox-env }}-${{ runner.os }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
- name: Set up environment
run: |
pip install --upgrade pip wheel setuptools
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM python:3.10-slim

CMD python
82 changes: 81 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,91 @@ readme = "README.md"
requires-python = ">=3.10"
dynamic = ["version"]
dependencies = [
"aiosqlite",
"asgi-correlation-id",
"bluepyefe",
"efel",
"fastapi",
"langchain",
"langchain-cohere",
"langchain-openai",
"langgraph",
"langgraph-checkpoint-postgres",
"langgraph-checkpoint-sqlite",
"neurom",
"psycopg2-binary",
"pydantic-settings",
"python-dotenv",
"python-keycloak",
"python-multipart",
"sqlalchemy",
"uvicorn",
]

[project.optional-dependencies]
dev = [
"bandit[toml]",
"mypy",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-httpx",
"responses",
"ruff",
"types-requests",
]

[project.scripts]
neuroagent-api = "neuroagent.scripts.neuroagent_api:main"

[tool.setuptools.dynamic]
version = {attr = "neuroagent.__version__"}

[tool.setuptools.packages.find]
where = ["src"]
namespaces = false
namespaces = false

[tool.bandit]
exclude_dirs = ["tests"]

[tool.black]
line-length = 88
preview = true

[tool.ruff]
line-length = 88
target-version = "py310"

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "I", "D"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D"]

[tool.mypy]
mypy_path = "src"
python_version = "3.10"
ignore_missing_imports = true
no_implicit_optional = true
check_untyped_defs = true
strict_equality = true
warn_redundant_casts = true
warn_unused_ignores = true
show_error_codes = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
plugins = [
"pydantic.mypy", "sqlalchemy.ext.mypy.plugin"
]

[tool.pytest.ini_options]
minversion = "6.0"
testpaths = [
"tests",
]

addopts = "--cov=src/ --cov=tests/ -v --cov-report=term-missing --durations=20 --no-cov-on-fail"
4 changes: 3 additions & 1 deletion src/neuroagent/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = "0.0.0"
"""Neuroagent package."""

__version__ = "0.0.0"
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Neuroagent tests."""
5 changes: 5 additions & 0 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Dummy test"""


def test_dummy():
assert True

0 comments on commit 1a260b7

Please sign in to comment.