Skip to content

use py-template - #281

Merged
dtrifiro merged 8 commits into
treeverse:mainfrom
dtrifiro:use-py-template
Sep 8, 2022
Merged

dtrifiro merged 8 commits into
treeverse:mainfrom
dtrifiro:use-py-template

Conversation

@dtrifiro

@dtrifiro dtrifiro commented Sep 1, 2022 •

Copy link
Copy Markdown
Contributor

Use cruft/cookiecutter template from https://github.com/iterative/py-template

closes #272

@dtrifiro
dtrifiro requested review from daavoo, pared and skshetry and removed request for pared and skshetry September 1, 2022 09:56
@dtrifiro
dtrifiro marked this pull request as ready for review September 1, 2022 09:57
@dtrifiro
dtrifiro marked this pull request as draft September 1, 2022 10:01
Comment thread .cruft.json Outdated
Comment thread .cruft.json Outdated
Comment thread .cruft.json Outdated
Comment thread setup.cfg Outdated
Comment thread setup.cfg Outdated
Comment thread setup.cfg Outdated
@dtrifiro
dtrifiro force-pushed the use-py-template branch 2 times, most recently from e181bb6 to ecc74d3 Compare September 1, 2022 10:37
@dtrifiro
dtrifiro marked this pull request as ready for review September 1, 2022 10:37
This was referenced Sep 1, 2022
Comment thread setup.cfg Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up adding this because codespell was complaining:

src/dvclive/data/plot.py:58: fpr ==> for, far, fps
src/dvclive/data/plot.py:68: fpr ==> for, far, fps
src/dvclive/data/plot.py:73: fpr ==> for, far, fps
src/dvclive/data/plot.py:74: fpr ==> for, far, fps
src/dvclive/data/plot.py:111: fpr ==> for, far, fps
src/dvclive/data/plot.py:121: fpr ==> for, far, fps
src/dvclive/data/plot.py:127: fpr ==> for, far, fps
src/dvclive/data/plot.py:128: fpr ==> for, far, fps

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually add this to .pre-commit-config.yaml, to avoid adding more config to setup.cfg.

https://github.com/iterative/scmrepo/blob/bbcf8f337cf3ac33764c2c7fc227e8e7bd403cea/.pre-commit-config.yaml#L30

I see that there is a PR for pyproject.toml support: codespell-project/codespell#2290.

It's good for now.

@skshetry

skshetry commented Sep 1, 2022

Copy link
Copy Markdown
Collaborator

I will try to review it by tomorrow. 🙂

@pared pared left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions:

  1. Are most of the changes automatically generated?
    a.) I see a lot of mentions of my name, and while I am flattered, I think there should be more Iterative and less Paweł Redzyński :D
    b.) Do we need this huge .gitignore? There are rules for cython, django and so on while I am not sure there is a chance for stumbling upon them while developing this package.

@skshetry

skshetry commented Sep 2, 2022

Copy link
Copy Markdown
Collaborator

b.) Do we need this huge .gitignore? There are rules for cython, django and so on while I am not sure there is a chance for stumbling upon them while developing this package.

I can answer this question. It's a template from https://github.com/github/gitignore, and it has made all the decisions for us regarding useful gitignores required for a Python library/application. It's true that we might not use these libraries, but we might use them on some projects, it's one py-template satisfying all of our projects' needs.
The ignores in that file is reasonable, and we are unlikely to ever be in conflict.

Adding some entries to the .gitignore in the future, even though it improves your quality of life, is going to be difficult, with potential pushbacks or suggestions to work around. Eg: In dvc, we didn't have venv for so long, and proposing one would surely get pushback, suggestions to just use env or to use .git/info/exclude. It's better to start with a standard template of .gitignore, I think. Tbh I don't see any harm with huge .gitignore.

I'm happy to discuss more and open to change. I'll suggest opening an issue on py-template if you disagree and we can reach a consensus. 🙂

@skshetry

skshetry commented Sep 2, 2022

Copy link
Copy Markdown
Collaborator

@dtrifiro, what about the order, do they match with py-template? That's the only thing I want to review here. 😄

Otherwise, update-template may keep on raising conflicts.

@pared

pared commented Sep 2, 2022 •

Copy link
Copy Markdown
Contributor

It was there before, so I left it 🙂, I think it should stay, unless you want it removed?

I don't mind it, just don't want to take credit for our collective work :)
However, I would probably change to Iterative in the License, as it seems that Iterative is a License provider, even if I am an author

Comment thread .pre-commit-hooks.yaml Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did dvclive provide pre-commit hooks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean here. I think this can be safely replaced with .pre-commit-config.yaml

Comment thread pyproject.toml Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does dvclive need to provide version info?

>>> from importlib.metadata import version; version('dvclive')

Users can get this with above ^.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got rid of it, as well as getting rid of src/dvclive/version.py

Comment thread pyproject.toml Outdated
Comment thread setup.cfg Outdated
Comment thread setup.cfg Outdated
Comment thread setup.cfg Outdated

@skshetry skshetry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@codecov-commenter

codecov-commenter commented Sep 5, 2022 •

Copy link
Copy Markdown

Codecov Report

Base: 90.67% // Head: 93.43% // Increases project coverage by +2.75% 🎉

Coverage data is based on head (a426332) compared to base (ca3dc22).
Patch coverage: 96.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #281      +/-   ##
==========================================
+ Coverage   90.67%   93.43%   +2.75%     
==========================================
  Files          21       35      +14     
  Lines         751     1554     +803     
  Branches        0      169     +169     
==========================================
+ Hits          681     1452     +771     
- Misses         70       80      +10     
- Partials        0       22      +22     
Impacted Files Coverage Δ
src/dvclive/__init__.py 100.00% <ø> (ø)
src/dvclive/catalyst.py 100.00% <ø> (ø)
src/dvclive/data/image.py 88.88% <ø> (ø)
src/dvclive/data/utils.py 75.00% <ø> (ø)
src/dvclive/dvc.py 19.35% <0.00%> (ø)
src/dvclive/env.py 100.00% <ø> (ø)
src/dvclive/error.py 86.95% <ø> (ø)
src/dvclive/fastai.py 92.85% <ø> (ø)
src/dvclive/huggingface.py 100.00% <ø> (ø)
src/dvclive/keras.py 100.00% <ø> (ø)
... and 40 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dtrifiro

dtrifiro commented Sep 7, 2022

Copy link
Copy Markdown
Contributor Author

With the lastest push I got rid of src/dvclive/{_,}version.py and updated pyproject.toml accordingly. Will merge by the end of the day if nobody has any other comments.

@daavoo daavoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't really reviewed in-depth, but looks good on high level so let's merge and follow up if needed

Comment thread .gitignore Outdated

@pared pared left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though as I mentioned, I think we should change in the LICENSE to Iterative, from Paweł Redzyński. I am the author, but I believe its Iterative who provides the license to use, as I created it under Iterative's name.

Comment thread setup.cfg Outdated
Co-authored-by: skshetry <suagatchhetri@outlook.com>
@dtrifiro
dtrifiro merged commit d658bd6 into treeverse:main Sep 8, 2022
@dtrifiro

dtrifiro commented Sep 8, 2022

Copy link
Copy Markdown
Contributor Author

Thanks everybody!

@dtrifiro
dtrifiro deleted the use-py-template branch September 8, 2022 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync with py-template?

5 participants