release script
stg7 opened this issue · 13 comments
I always get
sgoering@avt29 ~/p/bitstream_mode3_p1204_3> ./release.py -n patch master!?
Current version: 0.1.1
move to next version inside repo: 0.1.2
update pyproject.toml
update p1204_3/__init__.py
committing and pushing to remote
git commit -m 'move to next version: 0.1.2'
git tag v0.1.2
poetry run gitchangelog
Traceback (most recent call last):
File "./release.py", line 102, in <module>
main()
File "./release.py", line 90, in main
ch.write(changelog.decode("utf-8"))
AttributeError: 'str' object has no attribute 'decode'
@slhck can you confirm this, or did i missed something?
btw, can we implement the current master version to have, e.g. 0.1.2-dev?, what is your opinion?
can we add that it pushes to all remotes, or is this already handled? (didn't saw it)
I will check it. I needed to decode the output of the call but there might be a bug.
And I will add a push to all remotes. This is not handled at the moment.
I'm not sure how we can achieve that the current version is always -dev
. This would mean that we have to:
- Create the release
- Change the version in the
pyproject.toml
and__init__.py
files again - Make a commit
But having a commit to add -dev
seems weird.
Then we skip the idea of -dev
curious: with "#7" i get:
Current version: 0.1.1
move to next version inside repo: 0.1.2
update pyproject.toml
update p1204_3/__init__.py
committing and pushing to remote
Traceback (most recent call last):
File "./release.py", line 105, in <module>
main()
File "./release.py", line 85, in main
run_cmd(["git", "commit", "-m", message], cli_args.dry_run)
File "./release.py", line 16, in run_cmd
return subprocess.check_output(cmd).decode("utf-8")
File "/usr/lib/python3.7/subprocess.py", line 411, in check_output
**kwargs).stdout
File "/usr/lib/python3.7/subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'commit', '-m', 'move to next version: 0.1.2']' returned non-zero exit status 1.
dry run works now, dont know what is wrong now
That's strange. I will finally fix it tomorrow and make a new patch release on master, then I can better test it.
perfect
i have Python 3.7.5, on ubuntu 19.10, maybe it is a python related issue
the reason was fhe following (or similar):
Command '['git', 'commit', '-m', 'move to next version: 0.1.5']' returned non-zero exit status 1.
To github.com:Telecommunication-Telemedia-Assessment/bitstream_mode3_p1204_3.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:Telecommunication-Telemedia-Assessment/bitstream_mode3_p1204_3.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Command '['git', 'push', 'github']' returned non-zero exit status 1.
i added some error output to the command line
Ah! Maybe we should always pull/rebase before releasing.
yes, i think this would be a good way
I think I fixed it now, but it's always hard to test without actually running the script.
It will tell you if the local branch is not up to date, and exit.
Please check next time if any error occurs.