-
Notifications
You must be signed in to change notification settings - Fork 12
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
added pyproject.toml file #158
Conversation
try to install the package in a local development environment before your next push to this branch. there are some errors and warnings:
and
you can remove from importlib.metadata import version, PackageNotFoundError
try:
__version__ = version("package-name")
except PackageNotFoundError:
# package is not installed
__version__ = "unknown version, package not installed" before pushing to your branch, format your code with
|
by the way, github has a nice feature where you can link issues and pull requests in comments. you can even indicate that a pull request will close an issue, and once the pull request is merged, the issue is automatically close. see https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword i edited your first comment to say |
Sure. Since we're deleting _version.py, we will be fetching the version in init.py itself? |
@kaczmarj Solved the second error. Used the command |
try install the |
This is the tool.versioneer section in the toml file.
This is the init.py file. Even the whl file is named |
i'm not certain why but try removing versioneer entirely. remove the versioneer config from pyproject.toml as well. |
My bad. I used [tool.setuptools_scm] instead and it installed successfully. I'll commit to my branch |
I also wanted to ask. In the pyproject.toml file, I've included this line and it works just fine. [tool.setuptools_scm] Do we need additional arguments, like: # pyproject.toml
[tool.setuptools_scm]
version_file = "wsinfer/__init__.py" I'm not sure I understand the reason we're setting |
looking good! can you also delete the file
I am not sure... I will look online and get back to you.
This is a convention in python packages. See PEP 396 for more specifics, but in general, packages are expected to define the version in a top-level so setuptools is not reading the |
Got it. Thanks for the explanation! 9 tests have passed. The toml should be good to go, mostly. |
thanks @swaradgat19 ! i've been reading into setuptools_scm. i think it would be best to write the version to a static file and read it from there. to do this, can you change the in [tool.setuptools_scm]
write_to = "wsinfer/_version.py" in try:
from ._version import __version__
except ImportError:
__version__ = "0.0.unknown" and please add remember to run |
@kaczmarj My pleasure! Made the changes. Made separate commit for isort and black commands |
fixes #134