Skip to content
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

use py-template #281

Merged
merged 8 commits into from
Sep 8, 2022
Merged

use py-template #281

merged 8 commits into from
Sep 8, 2022

Conversation

dtrifiro
Copy link
Contributor

@dtrifiro dtrifiro commented Sep 1, 2022

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

closes #272

@dtrifiro dtrifiro requested review from skshetry, pared and daavoo and removed request for skshetry and pared 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
.cruft.json Outdated Show resolved Hide resolved
.cruft.json Outdated Show resolved Hide resolved
.cruft.json Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
@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
setup.cfg Outdated
show_traceback = True
pretty = True
[codespell]
ignore-words-list=
Copy link
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
Member

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
Copy link
Member

skshetry commented Sep 1, 2022

I will try to review it by tomorrow. 🙂

Copy link
Contributor

@pared pared left a comment

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
Copy link
Member

skshetry commented Sep 2, 2022

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
Copy link
Member

skshetry commented Sep 2, 2022

@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
Copy link
Contributor

pared commented Sep 2, 2022

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

@@ -1,12 +0,0 @@
- args:
Copy link
Member

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
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

pyproject.toml Outdated
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/dvclive/_version.py"
Copy link
Member

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
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

pyproject.toml Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
Copy link
Member

@skshetry skshetry left a comment

Choose a reason for hiding this comment

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

🔥

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2022

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
Copy link
Contributor Author

dtrifiro commented Sep 7, 2022

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.

Copy link
Contributor

@daavoo daavoo left a comment

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

.gitignore Outdated Show resolved Hide resolved
Copy link
Contributor

@pared pared left a comment

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.

setup.cfg Outdated Show resolved Hide resolved
Co-authored-by: skshetry <suagatchhetri@outlook.com>
@dtrifiro dtrifiro merged commit d658bd6 into iterative:main Sep 8, 2022
@dtrifiro
Copy link
Contributor Author

dtrifiro commented Sep 8, 2022

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