42 Commits

Author SHA1 Message Date
Jacob Hinkle
e76489b1c0 Fix missing store table row after Store.init() 2022-10-11 13:04:57 -04:00
Jacob Hinkle
7a0fea9a80 Fix missing .hex() when inserting SHA256 2022-10-11 12:49:11 -04:00
Jacob Hinkle
8e69ca3390 Many changes to keys and move persist() to fs.py
This fixes a lot of awkwardness that came from having the record()
functionality inside of store.py. It is still broken, but is much closer
to actually working now. I also sketched some data and io functionality,
which has no tests and is not yet working at all.
2022-10-11 12:27:40 -04:00
Jacob Hinkle
07ccef601c Change to using UUID and SHA256 as DB keys
This is important for distributed settings, and will make merging
databases much simpler. This change is pretty extensive and includes a
lot of other stuff like moving some fields between tables, and
introducing the `local_metadata` table which is a key-value store and
holds the uuid of the "local" store, i.e. the one corresponding to the
directory holding that particular nancy.db.
2022-10-10 15:14:47 -04:00
Jacob Hinkle
c4648ec042 Add tox with mypy, fix typehints. Upgrade black pre-commit hook 2022-10-04 20:56:38 -04:00
Jacob Hinkle
25ab58bcda Rearrange flake.nix to call mkPoetryEnv directly instead of with mkShell 2022-09-30 20:13:49 -04:00
Jacob Hinkle
1fd60cc4f7 Change name of command from diff to status 2022-09-29 13:14:13 -04:00
Jacob Hinkle
630231ab63 Fix all linting errors 2022-09-28 13:51:22 -04:00
Jacob Hinkle
36b1038861 Add black as pre-commit hook 2022-09-28 12:30:43 -04:00
Jacob Hinkle
b72051ff75 Run "black" on all python code 2022-09-28 12:21:49 -04:00
Jacob Hinkle
e4b380b2c1 Merge branch 'master' of git.jhink.org:jacob/nancy 2022-09-28 12:20:14 -04:00
9fb399a3d9 Remove stale trivial_save.py example 2022-09-28 12:15:24 -04:00
2d5816a504 Fix diff, at least for simple once-recorded test case 2022-09-27 15:57:48 -04:00
45c2046fd6 Update schema putting more into filedir_version 2022-09-27 11:26:05 -04:00
cb53db3bcd Added loguru 2022-09-27 11:25:25 -04:00
6c62d0568d Create cli.common, begin record command 2022-09-25 12:43:11 -04:00
07f6347d49 Clean up color in diff cli. Fix symlink detection 2022-09-23 20:49:00 -04:00
a750b53a10 Exclude ./nancy.db from FSEntry.from_path() scanning by default 2022-09-23 20:15:41 -04:00
183e3ed613 Add working FSDiff and new diff command.
This uses colorama so that is added to poetry. Next I'll add the diff
printing to the record command and have the corresponding store method
use the diff as input.
2022-09-23 20:12:10 -04:00
bf141afa5f Add UUID to store table. 2022-09-23 08:41:20 -04:00
fb6a54c6ef Clean up schema and add filedir_versions table 2022-09-22 15:47:49 -04:00
9d48d4d227 Enable contraint parent.filetype='DIR' in filedir 2022-09-22 10:08:30 -04:00
8d6395ecd1 Rename store_file table to filedir 2022-09-22 10:03:44 -04:00
a5cbce3c66 Rename do_record as record in order to facilitate re-use 2022-09-22 09:58:33 -04:00
f55d110e49 Programs are now recorded in the store.
The record() program and cli is not yet working. For that we need a
working `FSDiff` next.  Then we'll finally be ready to start recording
file information.
2022-09-21 21:23:20 -04:00
f18368f1e0 Add Program, Environment, User, Machine, with auto insertion
Also removed freeze and thaw, and converted to record().
2022-09-21 20:51:57 -04:00
d0f113645b Create schema submodule holding versioned schemas
This is meant to hold schemas and migrations. It contains an
`__init__.py` due to a limitation of `importlib.resources` outlined in
detail here: https://github.com/python/importlib_resources/issues/58

Eventually the schema submodule will handle automatic migration of older
databases when importing into new stores.
2022-09-21 13:50:46 -04:00
e75af52765 Create {machine,fs}.py, file scanning, and updated tests
This also fixes the pytest fixture setup (I think).
2022-09-21 13:37:05 -04:00
c30ca6a083 Add more Store functionality 2022-09-20 12:09:09 -04:00
3a99a14a0a Clean up db.py 2022-09-20 12:08:48 -04:00
3ae90db4a8 Add sqlite to flake devshell 2022-09-20 12:07:45 -04:00
311990d5f6 Update schema and add tests which don't rely on python 2022-09-20 12:07:32 -04:00
9e7af6b8a1 Fix up poetry/flake, add stubs for some cli functions 2022-09-19 09:31:41 -04:00
6b28b10094 Update example to reflect name change 2022-09-18 19:44:13 -04:00
9a757da130 Add entry_point, remove setuptools_scm 2022-09-18 19:43:28 -04:00
10f5fac0e7 Add schema_version on python side, with match test 2022-09-18 19:43:05 -04:00
cbb8180ff3 Add cli and version.py 2022-09-18 19:41:48 -04:00
cde9a9056c Add poetry setup 2022-09-18 19:41:08 -04:00
ca2f9ea014 Add flake.nix and flake.lock 2022-09-17 13:23:07 -04:00
68ec5ca286 Add trivial_save.py example 2022-09-17 12:57:44 -04:00
007c22d3e2 Rename to nancy 2022-09-17 12:57:15 -04:00
6858489b0b Add first draft of schema, setuptools, gitignore 2022-09-16 15:04:57 -04:00