Skip to content

Conversation

@Aluriak
Copy link
Contributor

@Aluriak Aluriak commented Mar 4, 2021

I have some experience with creating and maintaining python packages. Do not hesitate to ask me if you need help.

This commit uses the simpler and more reliable declarative syntax (setup.cfg), and pushes the __version__ information into the __init__.py as i usually observed in most packages.

@elebescond
Copy link
Member

Thx @Aluriak,

version.py is useful for bumpversion command

$ make bump-snapshot rm --force --recursive build/ rm --force --recursive dist/ rm --force --recursive *.egg-info bumpversion build; Traceback (most recent call last): File "C:\Users\erwan_lebescond\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\erwan_lebescond\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\DevHome\tock-py\venv\Scripts\bumpversion.exe\__main__.py", line 7, in <module> File "c:\devhome\tock-py\venv\lib\site-packages\bumpversion\cli.py", line 124, in main _check_files_contain_version(files, current_version, context) File "c:\devhome\tock-py\venv\lib\site-packages\bumpversion\cli.py", line 618, in _check_files_contain_version f.should_contain_version(current_version, context) File "c:\devhome\tock-py\venv\lib\site-packages\bumpversion\utils.py", line 51, in should_contain_version if self.contains(search_expression): File "c:\devhome\tock-py\venv\lib\site-packages\bumpversion\utils.py", line 78, in contains with open(self.path, "rt", encoding="utf-8") as f: FileNotFoundError: [Errno 2] No such file or directory: './tock/__version__.py' make: *** [Makefile:7: bump-snapshot] Error 1

@Aluriak
Copy link
Contributor Author

Aluriak commented Mar 8, 2021

I didn't know about bumpversion. Note that it is recommended to use the maintained fork, i.e. bump2version.

Bumpversion seems to handle some configuration in the setup.cfg. These lines, according to the readme, should be enough :

[bumpversion]
commit = True
tag = True
current_version = 1.0.1

[bumpversion:file:tock/__init__.py]

I added them to another commit.

@Aluriak
Copy link
Contributor Author

Aluriak commented Mar 8, 2021

Btw, if you need to automate or simplify the publication of the package, not just the version upgrade, i would happily point you to zest.releaser.

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.

2 participants