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

Migrated the metadata into PEP 621-compliant pyproject.toml. #179

Merged
merged 3 commits into from Oct 6, 2022
Merged

Migrated the metadata into PEP 621-compliant pyproject.toml. #179

merged 3 commits into from Oct 6, 2022

Conversation

KOLANICH
Copy link
Contributor

No description provided.

@astanin
Copy link
Owner

astanin commented Jun 22, 2022

I don't like moving tabulate.py to tabualte/init.py. I don't see any advantage of doing it when the library is a single module.

For a library like this it is often convenient to just drop a file into another project, rather than adding a dependency. Happened to me in the past.

@KOLANICH
Copy link
Contributor Author

I don't like moving tabulate.py to tabualte/init.py. I don't see any advantage of doing it when the library is a single module.

It is done by technical reasons: setuptools_scm generates a file with version information. Otherwise one will have to retrieve it in runtime, which will slow down the module loading. To be honest, that info is not really needed in a variable and I'd prefer to remove it at all, and if someone really needs it, he can retrieve it in runtime using pkg_resources. I have removed the manually hardcoded version info as it is a burden to update it manually. Now one has to only create a git tag to make a new release.

For a library like this it is often convenient to just drop a file into another project, rather than adding a dependency. Happened to me in the past.

  1. Yes, the requirement to build a wheel to generate version information complicates the process.
  2. We can avoid it if we wrapped the import into a try-except construct. Then it should be as simple as copying a dir, which is as easy as copying a file.
  3. BTW, the process of copying the dependency into the source is known as "vendorization" and there is a tool for it https://github.com/mwilliamson/python-vendorize
  4. It is considered as an antipattern because it creates dependency hell. That's why vendorization is usually used for system-critical packages like setuptools and pip, without which working it will not be possible to fix the situation with them not working easily. It is still a dependency hell though.

@astanin astanin added the enhancement New feature or request label Oct 6, 2022
@astanin astanin added this to the v0.9 milestone Oct 6, 2022
@astanin astanin changed the base branch from master to dev-pep621 October 6, 2022 10:42
@astanin astanin merged commit 6e37802 into astanin:dev-pep621 Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants