You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just upgraded to the latest version of python-semantic-release (previously was using 6.2.5, now using 9.0.3).
Before, I was using a very small setup.cfg file for semantic-release configurations. Since this new upgrade, support for a setup.cfg has been moved to pyproject.toml.
I am fairly new to using a TOML file, so after reading the documentation I discovered I could use semantic-release generate-config to create a TOML block for semantic-release. I copied this output into my local pyproject.toml and then I also added some basics for the [project] section as well.
No matter what I do, when I run semantic-release version --noop or semantic-release publish --noop I get the following error:
I have tried commenting out everything in my pyproject.toml file and leaving just bare minimums and I still get this error. The error goes away if I remove the file entirely and run those commands however, semantic-release is not configured to look at the branches that I need it too so I get:
branch 'develop' isn't in any release groups; no release will be made
My pyproject.toml file consists of the following currently:
Please also indicate which Python build tool(s) you are using (e.g. pip, build, poetry, etc.), including the version number too.
No build tools are currently in place.
Logging
Using semantic-release -vv version --noop:
[12:13:56] DEBUG [semantic_release.cli.commands.main] DEBUG main.main: logging level set to: DEBUG main.py:105
DEBUG [git.util] DEBUG util.is_cygwin_git: Failed checking if running in CYGWIN due to: FileNotFoundError(2, 'No such file or directory') util.py:420
DEBUG [semantic_release.cli.commands.main] DEBUG main.main: global cli options: GlobalCommandLineOptions(noop=False, verbosity=2, config_file='pyproject.toml', main.py:123
strict=False)
INFO [semantic_release.cli.util] INFO util.load_raw_config_file: Loading configuration from pyproject.toml util.py:78
DEBUG [semantic_release.cli.util] DEBUG util.load_raw_config_file: Trying to parse configuration pyproject.toml in TOML format util.py:81
Traceback (most recent call last):
File "/usr/local/bin/semantic-release", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1685, in invoke
super().invoke(ctx)
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/semantic_release/cli/commands/main.py", line 142, in main
config_text = load_raw_config_file(config_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/semantic_release/cli/util.py", line 82, in load_raw_config_file
return parse_toml(raw_text)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/semantic_release/cli/util.py", line 53, in parse_toml
toml_text = tomlkit.loads(raw_text).unwrap()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TOMLDocument' object has no attribute 'unwrap'
The text was updated successfully, but these errors were encountered:
This is a tomlkit version conflict. Thank you for finding this, it was unknown there was a compatibility issue with our minimum tomlkit version dependency. Your version 0.10.2 does not have the unpack() function on the TOMLContainer. Please upgrade tomlkit>=0.11.0.
Also your configuration is partially correct. When inside the pyproject.toml file, each TOML Table heading should be [tool.semantic_release.*]. Tables are basically converted into dictionaries or namespaces so you can think of the syntax that way. All your commented out TOML is missing the tool. prefix which is required when it is in the pyproject.toml file to be in accordance with PEP 517/518.
This info is in the help text of generate-config but I'll say it here anyway--PSR prints out configurations in 2 formats: JSON or TOML. There is an additional option --pyproject which will make sure to add the tool. prefix to the tables headers when printing the TOML.
codejedi365
added a commit
to codejedi365/python-semantic-release
that referenced
this issue
Feb 9, 2024
TOMLDocument is missing the `unwrap()` function in `v0.10.2` which
causes an AttributeError to occur when attempting to read a the text
in `pyproject.toml` as discovered with python-semantic-release#834Resolves: python-semantic-release#834
TOMLDocument is missing the `unwrap()` function in `v0.10.2` which
causes an AttributeError to occur when attempting to read a the text
in `pyproject.toml` as discovered with #834Resolves: #834
The problem
I just upgraded to the latest version of python-semantic-release (previously was using
6.2.5
, now using9.0.3
).Before, I was using a very small
setup.cfg
file for semantic-release configurations. Since this new upgrade, support for asetup.cfg
has been moved topyproject.toml
.I am fairly new to using a TOML file, so after reading the documentation I discovered I could use
semantic-release generate-config
to create a TOML block for semantic-release. I copied this output into my localpyproject.toml
and then I also added some basics for the[project]
section as well.No matter what I do, when I run
semantic-release version --noop
orsemantic-release publish --noop
I get the following error:I have tried commenting out everything in my
pyproject.toml
file and leaving just bare minimums and I still get this error. The error goes away if I remove the file entirely and run those commands however, semantic-release is not configured to look at the branches that I need it too so I get:My
pyproject.toml
file consists of the following currently:Am I doing something wrong with my
pyproject.toml
file or is something else wrong?Expected behavior
When running
semantic-release version --noop
I would expect to see the version change if there is one applicable.Environment
Please state which OS you are using and provide the output of the following commands:
Output:
Please also indicate which Python build tool(s) you are using (e.g.
pip
,build
,poetry
, etc.), including the version number too.No build tools are currently in place.
Logging
Using
semantic-release -vv version --noop
:The text was updated successfully, but these errors were encountered: