rair 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. rair-0.1.2/.github/workflows/ci.yml +36 -0
  2. rair-0.1.2/.github/workflows/publish.yml +39 -0
  3. rair-0.1.2/.gitignore +10 -0
  4. rair-0.1.2/LICENSE +21 -0
  5. rair-0.1.2/PKG-INFO +249 -0
  6. rair-0.1.2/README.md +231 -0
  7. rair-0.1.2/pyproject.toml +55 -0
  8. rair-0.1.2/rair/__init__.py +7 -0
  9. rair-0.1.2/rair/__main__.py +6 -0
  10. rair-0.1.2/rair/archive.py +408 -0
  11. rair-0.1.2/rair/auto_detect.py +166 -0
  12. rair-0.1.2/rair/cli.py +166 -0
  13. rair-0.1.2/rair/cli_parser.py +72 -0
  14. rair-0.1.2/rair/config.py +261 -0
  15. rair-0.1.2/rair/core.py +216 -0
  16. rair-0.1.2/rair/git.py +120 -0
  17. rair-0.1.2/rair/hashing.py +11 -0
  18. rair-0.1.2/rair/models.py +53 -0
  19. rair-0.1.2/rair/rair.egg-info/PKG-INFO +249 -0
  20. rair-0.1.2/rair/rair.egg-info/SOURCES.txt +45 -0
  21. rair-0.1.2/rair/rair.egg-info/dependency_links.txt +1 -0
  22. rair-0.1.2/rair/rair.egg-info/entry_points.txt +2 -0
  23. rair-0.1.2/rair/rair.egg-info/requires.txt +10 -0
  24. rair-0.1.2/rair/rair.egg-info/top_level.txt +1 -0
  25. rair-0.1.2/rair/script_type.py +60 -0
  26. rair-0.1.2/rair/setup.py +226 -0
  27. rair-0.1.2/rair/tracking.py +88 -0
  28. rair-0.1.2/rair/utils.py +66 -0
  29. rair-0.1.2/setup.cfg +4 -0
  30. rair-0.1.2/tests/__init__.py +1 -0
  31. rair-0.1.2/tests/mymodel.py +10 -0
  32. rair-0.1.2/tests/test_archive.py +373 -0
  33. rair-0.1.2/tests/test_auto_detect.py +284 -0
  34. rair-0.1.2/tests/test_auto_discover.py +139 -0
  35. rair-0.1.2/tests/test_cli.py +252 -0
  36. rair-0.1.2/tests/test_cli_e2e.py +118 -0
  37. rair-0.1.2/tests/test_cli_parser.py +175 -0
  38. rair-0.1.2/tests/test_config.py +725 -0
  39. rair-0.1.2/tests/test_core.py +620 -0
  40. rair-0.1.2/tests/test_data_versioning.py +270 -0
  41. rair-0.1.2/tests/test_git.py +201 -0
  42. rair-0.1.2/tests/test_models.py +125 -0
  43. rair-0.1.2/tests/test_run_json.py +336 -0
  44. rair-0.1.2/tests/test_script_type.py +158 -0
  45. rair-0.1.2/tests/test_setup.py +299 -0
  46. rair-0.1.2/tests/test_tracking.py +131 -0
  47. rair-0.1.2/tests/test_utils.py +128 -0
@@ -0,0 +1,36 @@
1
+ name: CI Pipeline
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ${{ matrix.os }}
12
+
13
+ strategy:
14
+ matrix:
15
+ os: [ubuntu-latest, windows-latest]
16
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
17
+
18
+ steps:
19
+ - name: Check out code
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ python -m pip install -e .[dev]
31
+
32
+ - name: Type checking with mypy
33
+ run: mypy
34
+
35
+ - name: Run tests with pytest
36
+ run: pytest
@@ -0,0 +1,39 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ publish:
10
+ name: Build and publish
11
+ runs-on: ubuntu-latest
12
+
13
+ environment:
14
+ name: pypi
15
+ url: https://pypi.org/project/${{ github.event.repository.name }}/
16
+
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+
20
+ - name: Ensure this is main branch
21
+ if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
22
+ run: echo "Proceeding with publish"
23
+
24
+ - uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.11"
27
+
28
+ - name: Install build tools
29
+ run: python -m pip install --upgrade build twine
30
+
31
+ - name: Build package
32
+ run: python -m build
33
+
34
+ - name: Publish to PyPI
35
+ env:
36
+ TWINE_USERNAME: __token__
37
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
38
+
39
+ run: python -m twine upload dist/*
rair-0.1.2/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.venv*
2
+ *.pyc
3
+ __pycache__
4
+ /results
5
+ *.egg-info
6
+ /rairarchive
7
+ /.rair_cache
8
+ /tests/output
9
+ /dist
10
+ rair/_version.py
rair-0.1.2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nicolas Kruse, German Aerospace Center (DLR)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
rair-0.1.2/PKG-INFO ADDED
@@ -0,0 +1,249 @@
1
+ Metadata-Version: 2.4
2
+ Name: rair
3
+ Version: 0.1.2
4
+ Summary: Simple data versioning
5
+ Classifier: Programming Language :: Python :: 3
6
+ Classifier: Operating System :: OS Independent
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: typer>=0.12.0
11
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11"
12
+ Provides-Extra: dev
13
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
14
+ Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
15
+ Requires-Dist: pytest-mock>=3.12.0; extra == "dev"
16
+ Requires-Dist: mypy>=1.8.0; extra == "dev"
17
+ Dynamic: license-file
18
+
19
+ # Rair - Research Archival & Integrity Recorder
20
+
21
+ Rair is a CLI-tool for simple data versioning.
22
+
23
+ When running experiments, model parameters and model details needs to be tweaked
24
+ frequently. Committing minimal changes clutters the git history and makes it hard to track
25
+ actual program modifications. Rair allows to link computation results to exact code versions
26
+ without the need to commit all changes to git. Therefore it stores code diffs alongside the git commit
27
+ reference. It tracks input and intermediate data as well to guarantee full reproducibility for every run.
28
+
29
+ Using heuristics, Rair can be used in many scenarios without any manual configuration.
30
+
31
+ ## Usage example
32
+
33
+ Suppose you have a simple script `mymodel.py` committed to git, looking like this:
34
+
35
+ ```python
36
+ import time
37
+
38
+ print('Test text output to stdio')
39
+ p1 = 5.9
40
+ p2 = 9.5
41
+
42
+ with open("test_result.txt", "w") as f:
43
+ current_time = time.strftime("%Y-%m-%d %H:%M:%S")
44
+ f.write(f"Current time: {current_time}\n")
45
+ f.write(f"result = {p1 + p2}\n")
46
+ ```
47
+
48
+ You tune some parameters (here `p1` and `p2`) without committing the changes to git.
49
+
50
+ Now you run your script like this:
51
+
52
+ ```bash
53
+ rair mymodel.py
54
+ ```
55
+
56
+ Rair runs the script and creates an archive with the following structure:
57
+
58
+ ```
59
+ rairarchive/
60
+ ├── data/
61
+ │ └── 9157ce88256e95668977_test_result.txt # deduplicated data file
62
+ └── runs/
63
+ └── 20260603-001-023aa51f/
64
+ ├── info.md # human-readable run overview
65
+ ├── run.json # machine-readable run metadata
66
+ ├── out.txt # captured stdout/stderr
67
+ ├── git_diff.patch # uncommitted changes (patch format)
68
+ └── test_result.txt # output file (hardlink)
69
+ ```
70
+
71
+ The file `info.md` gives an overview of the run:
72
+
73
+ ```markdown
74
+ # Run Information
75
+ - Start time: 2026-06-03 11:53:09
76
+ - Execution time: 0.185 s
77
+ - Command: `python mymodel.py`
78
+ - Run hash: `023aa51fa4981ebe097f2045947d2108cff014c42332d5f6ef5a9d71cbf5273b`
79
+
80
+ ## Git Information
81
+ - Commit: `95aa8c491f8a3e5c44890ea3c6616e123692c4cd`
82
+ - Short git hash: `95aa8c4`
83
+ - Branch: `main`
84
+ - Tracking URL: `no-upstream`
85
+
86
+ ## Uncommitted Changes
87
+ in mymodel.py:
88
+ p1 = 7.1
89
+ p2 = 3.3
90
+
91
+ ## Output Files
92
+ - `test_result.txt` -> `rairarchive/data/9157ce88256e95668977_test_result.txt` (hash: `9157ce88`)
93
+ ```
94
+
95
+ The "Run hash" captures the git hash, code diff, command line parameters and input file content.
96
+
97
+ ## Install
98
+
99
+ Rair can be installed with pip. Its tested on Windows and Unix:
100
+
101
+ ```bash
102
+ pip install rair
103
+ ```
104
+
105
+ ## Features
106
+
107
+ - **Auto-discovery**: Automatically discover input/output files using hash-based change detection for outputs
108
+ - **Hash caching**: Cache hash calculations in `.rair_cache/` for fast operation on large data files
109
+ - **Git diff tracking**: Track uncommitted changes alongside git commits
110
+ - **Archive format**: Human-readable markdown and machine-readable JSON
111
+ - **Flexible configuration**: Configure via CLI, or config file `.rair.toml`, or `pyproject.toml`
112
+ - **Output capture**: Captures stdout/stderr to a file
113
+ - **Deduplication**: Avoids storing duplicate data files by using content hashes
114
+ - **Selective tracking**: Use `--no-auto-discover` to require explicit `--input`/`--output`
115
+ - **Output hardlinks**: `--output-files-in-run` creates hardlinks for easy access
116
+ - **Default command**: Configure a default command to run when no script specified
117
+ - **Hierarchical config**: Local configs override project settings
118
+
119
+ ## Running Rair
120
+
121
+ ```bash
122
+ # Run a Python script with automatic tracking of all data files
123
+ # in the project directory
124
+ rair myscript.py
125
+
126
+ # Run a Python script with script arguments
127
+ rair myscript.py arg1 arg2
128
+
129
+ # Run with explicit command
130
+ rair python3 mymodel.py arg1 arg2
131
+
132
+ # The first argument can be a Python script or any arbitrary command
133
+ rair make --all
134
+
135
+ # Manually specify which files to track
136
+ rair --input "data/*.csv" --output "results/*.json" myscript.py
137
+
138
+ # If only input files are specified, outputs are auto-discovered
139
+ rair --input "data/*.csv" --input parameters.txt myscript.py
140
+
141
+ # Selective tracking - specify exactly which files to track
142
+ # Use --no-auto-discover to require explicit --input and --output
143
+ rair --no-auto-discover --input "data/*.csv" --output "results/*.json" myscript.py
144
+
145
+ # Run the default command set in config file and add
146
+ # a comment that is stored with the results
147
+ rair --comment "experiment 1"
148
+ ```
149
+
150
+ ### All CLI flags
151
+
152
+ ```
153
+ --config FILE Path to config file
154
+ --input TEXT Glob pattern for input files to track
155
+ --output TEXT Glob pattern for output files to track
156
+ --exclude TEXT Glob pattern to exclude from tracking
157
+ --archive-dir DIRECTORY Directory for archive data (default: rairarchive)
158
+ --autodata DIRECTORY Directory for auto-discovering input/output files
159
+ --capture-output/--no-capture-output
160
+ Capture stdout to out.txt [default: enabled]
161
+ --auto-discover/--no-auto-discover
162
+ Enable/disable auto-discovery [default: enabled]
163
+ --output-files-in-run Create hardlinks to output files in run folder
164
+ --comment TEXT Add a comment to the run
165
+ --setup Run interactive setup dialog
166
+ --help Show help message
167
+ ```
168
+
169
+ ## Configuration
170
+
171
+ As alternative to CLI parameters, configuration can be provided via a `.rair.toml` file or in `pyproject.toml` under `[tool.rair]`:
172
+
173
+ **.rair.toml:**
174
+ ```toml
175
+ archive_dir = "rairarchive"
176
+ input_glob = ["data/*.csv", "cache/*.pkl"]
177
+ output_glob = ["results/*.json", "logs/*.txt"]
178
+ exclude_glob = ["data/temp/*"]
179
+ autodata_dir = "./data"
180
+ capture_output = true
181
+ auto_discover = true # Enable auto-discovery (default)
182
+ output_files_in_run = false # Create hardlinks to outputs in run folder
183
+ default_command = "make" # Default command when no script specified
184
+ ```
185
+
186
+ **pyproject.toml:**
187
+ ```toml
188
+ [tool.rair]
189
+ archive_dir = "rairarchive"
190
+ input = ["data/*.csv", "cache/*.pkl"]
191
+ output = ["results/*.json", "logs/*.txt"]
192
+ exclude = ["data/temp/*"]
193
+ autodata_dir = "./data"
194
+ capture_output = true
195
+ auto_discover = true # Enable auto-discovery
196
+ output_files_in_run = false # Create hardlinks to outputs in run folder
197
+ default_command = "make" # Default command when no script specified
198
+ ```
199
+
200
+ ### Hierarchical Configuration
201
+
202
+ You can have different configurations for different directories:
203
+
204
+ - A `.rair.toml` in the current directory overrides project-level config
205
+ - Use `rair --setup` in subdirectories to create local configs
206
+ - Run `rair --setup` and choose "(c)urrent directory" or "(p)roject"
207
+
208
+ Example directory structure:
209
+ ```
210
+ project/
211
+ ├── .rair.toml # Project config
212
+ └── experiments/
213
+ ├── .rair.toml # Pverrides project config
214
+ └── train.py
215
+ ```
216
+
217
+ ## Developer Guide
218
+
219
+ Feedback and contributions are welcome - please open an issue or submit a pull request on GitHub.
220
+
221
+ To get started with development, first clone the repository:
222
+
223
+ ```bash
224
+ git clone https://github.com/DLR-Institute-of-Future-Fuels/rair.git
225
+ cd rair
226
+ ```
227
+
228
+ You may set up a virtual environment:
229
+
230
+ ```bash
231
+ python -m venv .venv
232
+ source .venv/bin/activate # On Windows: `.venv\Scripts\activate`
233
+ ```
234
+
235
+ Build and install the package and dev dependencies:
236
+
237
+ ```bash
238
+ pip install -e .[dev]
239
+ ```
240
+
241
+ Run the tests:
242
+
243
+ ```bash
244
+ pytest
245
+ ```
246
+
247
+ ## License
248
+
249
+ This project is licensed under the MIT license - see the [LICENSE](LICENSE) file for details.
rair-0.1.2/README.md ADDED
@@ -0,0 +1,231 @@
1
+ # Rair - Research Archival & Integrity Recorder
2
+
3
+ Rair is a CLI-tool for simple data versioning.
4
+
5
+ When running experiments, model parameters and model details needs to be tweaked
6
+ frequently. Committing minimal changes clutters the git history and makes it hard to track
7
+ actual program modifications. Rair allows to link computation results to exact code versions
8
+ without the need to commit all changes to git. Therefore it stores code diffs alongside the git commit
9
+ reference. It tracks input and intermediate data as well to guarantee full reproducibility for every run.
10
+
11
+ Using heuristics, Rair can be used in many scenarios without any manual configuration.
12
+
13
+ ## Usage example
14
+
15
+ Suppose you have a simple script `mymodel.py` committed to git, looking like this:
16
+
17
+ ```python
18
+ import time
19
+
20
+ print('Test text output to stdio')
21
+ p1 = 5.9
22
+ p2 = 9.5
23
+
24
+ with open("test_result.txt", "w") as f:
25
+ current_time = time.strftime("%Y-%m-%d %H:%M:%S")
26
+ f.write(f"Current time: {current_time}\n")
27
+ f.write(f"result = {p1 + p2}\n")
28
+ ```
29
+
30
+ You tune some parameters (here `p1` and `p2`) without committing the changes to git.
31
+
32
+ Now you run your script like this:
33
+
34
+ ```bash
35
+ rair mymodel.py
36
+ ```
37
+
38
+ Rair runs the script and creates an archive with the following structure:
39
+
40
+ ```
41
+ rairarchive/
42
+ ├── data/
43
+ │ └── 9157ce88256e95668977_test_result.txt # deduplicated data file
44
+ └── runs/
45
+ └── 20260603-001-023aa51f/
46
+ ├── info.md # human-readable run overview
47
+ ├── run.json # machine-readable run metadata
48
+ ├── out.txt # captured stdout/stderr
49
+ ├── git_diff.patch # uncommitted changes (patch format)
50
+ └── test_result.txt # output file (hardlink)
51
+ ```
52
+
53
+ The file `info.md` gives an overview of the run:
54
+
55
+ ```markdown
56
+ # Run Information
57
+ - Start time: 2026-06-03 11:53:09
58
+ - Execution time: 0.185 s
59
+ - Command: `python mymodel.py`
60
+ - Run hash: `023aa51fa4981ebe097f2045947d2108cff014c42332d5f6ef5a9d71cbf5273b`
61
+
62
+ ## Git Information
63
+ - Commit: `95aa8c491f8a3e5c44890ea3c6616e123692c4cd`
64
+ - Short git hash: `95aa8c4`
65
+ - Branch: `main`
66
+ - Tracking URL: `no-upstream`
67
+
68
+ ## Uncommitted Changes
69
+ in mymodel.py:
70
+ p1 = 7.1
71
+ p2 = 3.3
72
+
73
+ ## Output Files
74
+ - `test_result.txt` -> `rairarchive/data/9157ce88256e95668977_test_result.txt` (hash: `9157ce88`)
75
+ ```
76
+
77
+ The "Run hash" captures the git hash, code diff, command line parameters and input file content.
78
+
79
+ ## Install
80
+
81
+ Rair can be installed with pip. Its tested on Windows and Unix:
82
+
83
+ ```bash
84
+ pip install rair
85
+ ```
86
+
87
+ ## Features
88
+
89
+ - **Auto-discovery**: Automatically discover input/output files using hash-based change detection for outputs
90
+ - **Hash caching**: Cache hash calculations in `.rair_cache/` for fast operation on large data files
91
+ - **Git diff tracking**: Track uncommitted changes alongside git commits
92
+ - **Archive format**: Human-readable markdown and machine-readable JSON
93
+ - **Flexible configuration**: Configure via CLI, or config file `.rair.toml`, or `pyproject.toml`
94
+ - **Output capture**: Captures stdout/stderr to a file
95
+ - **Deduplication**: Avoids storing duplicate data files by using content hashes
96
+ - **Selective tracking**: Use `--no-auto-discover` to require explicit `--input`/`--output`
97
+ - **Output hardlinks**: `--output-files-in-run` creates hardlinks for easy access
98
+ - **Default command**: Configure a default command to run when no script specified
99
+ - **Hierarchical config**: Local configs override project settings
100
+
101
+ ## Running Rair
102
+
103
+ ```bash
104
+ # Run a Python script with automatic tracking of all data files
105
+ # in the project directory
106
+ rair myscript.py
107
+
108
+ # Run a Python script with script arguments
109
+ rair myscript.py arg1 arg2
110
+
111
+ # Run with explicit command
112
+ rair python3 mymodel.py arg1 arg2
113
+
114
+ # The first argument can be a Python script or any arbitrary command
115
+ rair make --all
116
+
117
+ # Manually specify which files to track
118
+ rair --input "data/*.csv" --output "results/*.json" myscript.py
119
+
120
+ # If only input files are specified, outputs are auto-discovered
121
+ rair --input "data/*.csv" --input parameters.txt myscript.py
122
+
123
+ # Selective tracking - specify exactly which files to track
124
+ # Use --no-auto-discover to require explicit --input and --output
125
+ rair --no-auto-discover --input "data/*.csv" --output "results/*.json" myscript.py
126
+
127
+ # Run the default command set in config file and add
128
+ # a comment that is stored with the results
129
+ rair --comment "experiment 1"
130
+ ```
131
+
132
+ ### All CLI flags
133
+
134
+ ```
135
+ --config FILE Path to config file
136
+ --input TEXT Glob pattern for input files to track
137
+ --output TEXT Glob pattern for output files to track
138
+ --exclude TEXT Glob pattern to exclude from tracking
139
+ --archive-dir DIRECTORY Directory for archive data (default: rairarchive)
140
+ --autodata DIRECTORY Directory for auto-discovering input/output files
141
+ --capture-output/--no-capture-output
142
+ Capture stdout to out.txt [default: enabled]
143
+ --auto-discover/--no-auto-discover
144
+ Enable/disable auto-discovery [default: enabled]
145
+ --output-files-in-run Create hardlinks to output files in run folder
146
+ --comment TEXT Add a comment to the run
147
+ --setup Run interactive setup dialog
148
+ --help Show help message
149
+ ```
150
+
151
+ ## Configuration
152
+
153
+ As alternative to CLI parameters, configuration can be provided via a `.rair.toml` file or in `pyproject.toml` under `[tool.rair]`:
154
+
155
+ **.rair.toml:**
156
+ ```toml
157
+ archive_dir = "rairarchive"
158
+ input_glob = ["data/*.csv", "cache/*.pkl"]
159
+ output_glob = ["results/*.json", "logs/*.txt"]
160
+ exclude_glob = ["data/temp/*"]
161
+ autodata_dir = "./data"
162
+ capture_output = true
163
+ auto_discover = true # Enable auto-discovery (default)
164
+ output_files_in_run = false # Create hardlinks to outputs in run folder
165
+ default_command = "make" # Default command when no script specified
166
+ ```
167
+
168
+ **pyproject.toml:**
169
+ ```toml
170
+ [tool.rair]
171
+ archive_dir = "rairarchive"
172
+ input = ["data/*.csv", "cache/*.pkl"]
173
+ output = ["results/*.json", "logs/*.txt"]
174
+ exclude = ["data/temp/*"]
175
+ autodata_dir = "./data"
176
+ capture_output = true
177
+ auto_discover = true # Enable auto-discovery
178
+ output_files_in_run = false # Create hardlinks to outputs in run folder
179
+ default_command = "make" # Default command when no script specified
180
+ ```
181
+
182
+ ### Hierarchical Configuration
183
+
184
+ You can have different configurations for different directories:
185
+
186
+ - A `.rair.toml` in the current directory overrides project-level config
187
+ - Use `rair --setup` in subdirectories to create local configs
188
+ - Run `rair --setup` and choose "(c)urrent directory" or "(p)roject"
189
+
190
+ Example directory structure:
191
+ ```
192
+ project/
193
+ ├── .rair.toml # Project config
194
+ └── experiments/
195
+ ├── .rair.toml # Pverrides project config
196
+ └── train.py
197
+ ```
198
+
199
+ ## Developer Guide
200
+
201
+ Feedback and contributions are welcome - please open an issue or submit a pull request on GitHub.
202
+
203
+ To get started with development, first clone the repository:
204
+
205
+ ```bash
206
+ git clone https://github.com/DLR-Institute-of-Future-Fuels/rair.git
207
+ cd rair
208
+ ```
209
+
210
+ You may set up a virtual environment:
211
+
212
+ ```bash
213
+ python -m venv .venv
214
+ source .venv/bin/activate # On Windows: `.venv\Scripts\activate`
215
+ ```
216
+
217
+ Build and install the package and dev dependencies:
218
+
219
+ ```bash
220
+ pip install -e .[dev]
221
+ ```
222
+
223
+ Run the tests:
224
+
225
+ ```bash
226
+ pytest
227
+ ```
228
+
229
+ ## License
230
+
231
+ This project is licensed under the MIT license - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,55 @@
1
+ [project]
2
+ name = "rair"
3
+ dynamic = ["version"]
4
+ description = "Simple data versioning"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ classifiers = [
8
+ "Programming Language :: Python :: 3",
9
+ "Operating System :: OS Independent",
10
+ ]
11
+ dependencies = [
12
+ "typer>=0.12.0",
13
+ 'tomli>=2.0.0; python_version < "3.11"',
14
+ ]
15
+
16
+ [build-system]
17
+ requires = ["setuptools>=61.0", "setuptools-scm>=8", "wheel"]
18
+ build-backend = "setuptools.build_meta"
19
+
20
+ [project.optional-dependencies]
21
+ dev = [
22
+ "pytest>=8.0.0",
23
+ "pytest-cov>=5.0.0",
24
+ "pytest-mock>=3.12.0",
25
+ "mypy>=1.8.0",
26
+ ]
27
+
28
+ [project.scripts]
29
+ rair = "rair.cli:app"
30
+
31
+ [tool.setuptools.packages.find]
32
+ where = ["rair"]
33
+
34
+ [tool.setuptools_scm]
35
+ version_scheme = "post-release"
36
+ local_scheme = "no-local-version"
37
+ tag_regex = "^v(?P<version>\\d+\\.\\d+\\.\\d+(?:-beta)?)$"
38
+ fallback_version = "0.0.0"
39
+ write_to = "rair/_version.py"
40
+ write_to_template = '''
41
+ # generated by setuptools_scm - do not edit
42
+ __version__ = "{version}"
43
+ '''
44
+
45
+ [tool.pytest.ini_options]
46
+ testpaths = ["tests"]
47
+
48
+ [tool.mypy]
49
+ strict = true
50
+ check_untyped_defs = true
51
+ no_implicit_optional = true
52
+ warn_return_any = true
53
+ warn_unused_configs = true
54
+ disallow_untyped_defs = true
55
+ files = ["rair"]
@@ -0,0 +1,7 @@
1
+ """Rair - Simple data versioning."""
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ from .cli import app
6
+
7
+ __all__ = ["app"]
@@ -0,0 +1,6 @@
1
+ """Entry point for `python -m rair`."""
2
+
3
+ from .cli import app
4
+
5
+ if __name__ == "__main__":
6
+ app()