-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔧 MAINTAIN: Improve repo configuration #112
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #112 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 1541 1544 +3
=========================================
+ Hits 1541 1544 +3
Continue to review full report at Codecov.
|
- Move config to `setup.cfg` and `pyproject.toml` - Add `Manifest.in`, `tox.ini` - Replace `requirements.txt`/`dev-requirements.txt with `requirements.lock` - Move from yapf to black code formatting - Add more pre-commit hooks - Update pylint version and fix new failures - Drop python 3.6
34dd190
to
a92c695
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is all good for me! I just made a couple of comments and questions out of curiosity.
One general question I still have is why we are changing yapf to black in this repo. I am assuming this was either discussed on the last aiida meeting, or with @giovannipizzi more directly, and he agreed to do the change (I mean, that part I think should be greenlighted by him rather than me). In that case feel free to go ahead and merge!
- Various general (but very important) speed improvements [\[#96\]](https://github.com/aiidateam/disk-objectstore/pull/96) [\[#102\]](https://github.com/aiidateam/disk-objectstore/pull/102) | ||
- Add callbacks to a number of functions (e.g. export, add_objects_to_pack, ... to allow showing progress bars or similar indicators [\[#96\]](https://github.com/aiidateam/disk-objectstore/pull/96) | ||
- Implement repacking (at least when not changing hashing or compression) [\[#96\]](https://github.com/aiidateam/disk-objectstore/pull/96) | ||
- Remove `export` function, implement `import_objects` function instead, to be called on the other side (it's more efficient) [\[#96\]](https://github.com/aiidateam/disk-objectstore/pull/96) | ||
- Add support for VACUUMing operations on the SQLite database (very important for efficiency) [\[#96\]](https://github.com/aiidateam/disk-objectstore/pull/96) | ||
- Add support for multiple hashing algorithms [\[#96\]](https://github.com/aiidateam/disk-objectstore/pull/96) | ||
- Add concept of (unique) `container_id` [\[#97\]](https://github.com/aiidateam/disk-objectstore/pull/97) | ||
- Generalize the compression algorithm implementation, and multiple algorithms are supported now [\[#99\]](https://github.com/aiidateam/disk-objectstore/pull/99) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=/ not sure why git doesn't recognize these as just being a few lines below...strange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backslash escapes in the link names [\[#97\]]
print(f"Time to retrieve {num_files} loose objects: {tot_time:.4} s") | ||
|
||
# Check that the content is correct | ||
for filename in retrieved: | ||
assert retrieved[filename] == files[filename], 'Mismatch (content) for {}, {} vs {}'.format( | ||
filename, retrieved[filename], files[filename] | ||
for filename, item in retrieved.items(): | ||
assert ( | ||
item == files[filename] | ||
), "Mismatch (content) for {}, {} vs {}".format( | ||
filename, item, files[filename] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for changing the above print to fstrings but not the string in the assert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was all done automatically by the pyupgrade
pre-commit hook. Guess it just missed a few for whatever reason
Creating 10000 files with UUID: 1.33 s | ||
Creating 10000 files with tempfile: 1.78 s No newline at end of file | ||
Creating 10000 files with tempfile: 1.78 s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, this is weird, these lines look the same...
I'm guessing black doing something strange with the end of line/file characters that are not visually shown? There is stuff like this in many other files too.
[options.extras_require] | ||
dev = | ||
coverage | ||
pre-commit | ||
pytest | ||
pytest-benchmark | ||
pytest-cov | ||
examples = | ||
click | ||
memory-profiler | ||
profilehooks | ||
psutil | ||
pywin32;platform_system == "Windows" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why are we using setup.cfg
here instead of setup.json
like in our other repos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup.json is a bespoke aiida solution, not supported by any PEP. The only reason we use it, is for compatibility with the aiida-registry (which eventually we should fix: aiidateam/aiida-registry#132, but this will be easier when everything moves to pyproject.toml
)
Oh they will all be getting changed: yapf was picked for whatever reason historically, but now black is easily the de facto standard; https://python.libhunt.com/compare-yapf-vs-black (and from a technical standpoint, I can tell you the way black parses the code is a lot more sound) |
setup.cfg
andpyproject.toml
Manifest.in
,tox.ini
requirements.txt
/dev-requirements.txt
withrequirements.lock
dev
extra todev
&examples