You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AICONTEXT-PYLIB.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Additional context on this repository for AI tools & coding agents
1
+
Additional context on this project for AI tools & coding agents
2
2
3
3
- Python 3.12+ code, unless otherwise specified
4
4
- Python code uses single outer quotes, including triple single quotes for e.g. docstrings
@@ -10,12 +10,13 @@ Additional context on this repository for AI tools & coding agents
10
10
- Try to stick to 120 characters per line
11
11
- if one of those comments would break this guideline, just put that comment above the line instead, as is standard convention
12
12
- If there is a pyproject.toml in place, use it as a reference for builds, installs, etc. The basic packaging and dev preference, including if you have to supply your own pyproject.toml, is as follows:
13
-
-Use pyproject.toml with hatchling, not e.g. setup.py
13
+
-Prefer hatchling build system over setuptools, poetry, etc. Avoid setuptools as much as possible. No setup.py.
14
14
- Reusable Python code modules are developed in the `pylib` folder, and installed using e.g. `uv pip install -U .`, which includes proper mapping to Python library package namespace via `tool.hatch.build.sources`. The `__init__.py` and other modules in the top-level package go directly in `pylib`, though submodules can use subdirectories, e.g. `pylib/a/b` becomes `installed_library_name.a.b`. Ultimately this will mean the installed package is importable as `from installed_library_name.etc import …`
15
-
- Yes this means editable and "dev mode" environments are NOT desirable, nor are shenanigans adding pylib to `sys.path`. Layer-efficient dockerization is an option if that's needed.
16
-
- The ethos is to always develop keeping things properly installable. No dev mode shortcuts
17
-
- Prefer hatchling build system over setuptools, poetry, etc. Avoid setuptools as much as possible. Use `[tool.hatch.build.sources]` to map source directories to package namespaces (e.g., `"pylib" = "installed_library_name"`).
18
15
- Use `[tool.hatch.build.targets.wheel]` with `only-include = ["pylib"]` to ensure the pylib directory structure gets included properly in the wheel, avoiding the duplication issue that can occur with sources mapping
16
+
- Yes this means editable and "dev mode" environments are NOT desirable, nor are shenanigans adding pylib to `sys.path`. Layer-efficient dockerization is an option if that's needed.
17
+
- The ethos is to always develop keeping things properly installable. No dev mode shortcuts. Substantive modification to libray code requires e.g. `uv pip install -U .` each time.
18
+
- Note: This avoidance of editable installs can be relaxed for non-library code, such as demos or main app launch scripts (e.g. webapp back ends)
19
+
- If it's a CLI provided as part of a library, though, it should still use proper installation via `[project.scripts]` entry points (e.g., `ooriscout = 'ooriscout.cli.scout:main'`), which creates console scripts that work correctly after `uv pip install -U .`. The CLI module lives in `pylib/cli/` and exposes a `main()` function that uses fire to handle command-line arguments.
19
20
-**Debugging package issues**: When modules aren't importing correctly after installation, check:
20
21
- That you are in the correct virtualenv (you may have to ask the developer)
21
22
- Package structure in site-packages (e.g., `ls -la /path/to/site-packages/package_name/`)
Copy file name to clipboardExpand all lines: demo/kgraph/README.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,7 @@ Basic `.onya` format example:
45
45
* occupation: Data Scientist
46
46
```
47
47
48
-
Key elements:
49
-
-**Document header**: Declares namespaces and base URI
50
-
-**Nodes**: Marked with `# NodeName [Type]`
48
+
There is a document header which declares namespaces and base IRIs (URIs). Node definitions are marked with `# NodeID [Type]`. The node ID is resolved against `@document` and the type against
0 commit comments