-
Notifications
You must be signed in to change notification settings - Fork 131
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
Support metadata.version in setup.cfg #83
Conversation
…sion to work in place of bumpversion.current_version. Fixes #62.
if section == 'bumpversion': | ||
try: | ||
items.append(('current_version', self.get('metadata', 'version'))) | ||
except Exception: |
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.
Probably this Exception and the one above should be narrower, configparser-specific exceptions.
tmpdir.chdir() | ||
main(['patch', '--verbose']) | ||
|
||
assert """[bumpversion] |
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.
Annoying that the [bumpversion]
section gets added, but that seems like an acceptable concession to make if no improvement could easily eliminate it.
cool! I'll take a look when I get some more time -- I spent some time this past weekend exploring the (new to me) |
See pypa/setuptools#1688 for the discussions on supporting pyproject.toml. |
@c4urself what do you think about |
While looking for a solution for #87 I checked out this PR and realised that when you have both a In this fork I tried to fix both #87 and that issue. There may be a more elegant solution but it seems to work fine. You're welcome to add those changes to your PR if you like, or I can open one myself. |
Any updates on this? |
#3) * Changed packaging so 'import pyglotaran' works out of the box * Added description how it works and known errors * Refined descripton of linter problem * Added editor config and .gitattributes * Reset version to 0.0.1, added __version__ to __init__.py and added bump2version config * Set the indentation style of setup.cfg to tab since this is the way it gets transformed by bump2version, which parses back configparsers sting * Added pre-commit autoupdate workflow * Removed PyPy as supported implementation * Fixed typo * Added project urls * Added python dependencies to dependabot and fixed version of glotaran * Reactivated deployment in CI-CD workflow I will keep in mind to create a new token * Removed __version__ attr of the module, since it gets overwritten anyway * Updated repo link to isort * Removed bump2version and it's config since it doesn't work with setup.cfg See c4urself/bump2version#83
#4) * Changed packaging so 'import pyglotaran' works out of the box * Added description how it works and known errors * Refined descripton of linter problem * Added editor config and .gitattributes * Reset version to 0.0.1, added __version__ to __init__.py and added bump2version config * Set the indentation style of setup.cfg to tab since this is the way it gets transformed by bump2version, which parses back configparsers sting * Added pre-commit autoupdate workflow * Removed PyPy as supported implementation * Fixed typo * Added project urls * Added python dependencies to dependabot and fixed version of glotaran * Reactivated deployment in CI-CD workflow I will keep in mind to create a new token * Removed __version__ attr of the module, since it gets overwritten anyway * Updated repo link to isort * Removed bump2version and it's config since it doesn't work with setup.cfg See c4urself/bump2version#83 * Updated isort repo rev and added .md to codespell checked files
As proposed in #62, this change allows
metadata.version
in a setup.cfg file to stand in forbumpversion.current_version
, meaning that with this change,bump2version
would work with zero config on a project using setuptools' declarative config with static version numbers.Although this technique worked, it feels a bit hacky, wrapping the configparser object and tricking the bumpversion code into thinking it's reading and writing the config value into the usual place(s).
I'm also not happy that it introduces an empty
bumpversion
section into thesetup.cfg
file when no section is needed. I'm out of time for now, so I want to get this published for review/comment. I look forward to your feedback.