Closed WillSewell closed 5 years ago
It's likely the python version is too new
Thanks for the suggestion. I tried 3.6.9, 3.5.7. and 3.4.10 but unfortunately I get the same error.
Hi, I am experiencing the exact same issue. Just wondering if there are any more details I can provide to try and help with this. I have tried with python 3.8, 3.7, 3.6, 3.5 and 3.3 as well as 2.7. Any updates would be much appreciated.
My log is attached:
Any idea when this issue started to occur?
Is it something recent?
I'm afraid I don't know. It's my first time using yotta.
Hi, The cause of the issue is a call to truncate in _semanticversion/base.py. The variable version points to an instance of class _yotta.lib.registryaccess.RegistryThingVersion which has no truncate method defined:
> /home/build/.local/lib/python3.7/site-packages/semantic_version/base.py(894)match()
-> version = version.truncate('prerelease')
(Pdb) l
889 self.build_policy = self.BUILD_STRICT if target.build else build_policy
890
891 def match(self, version):
892 if self.build_policy != self.BUILD_STRICT:
893 import pdb; pdb.set_trace()
894 -> version = version.truncate('prerelease')
895
896 if version.prerelease:
897 same_patch = self.target.truncate() == version.truncate()
898
899 if self.prerelease_policy == self.PRERELEASE_SAMEPATCH and not same_patch:
(Pdb) interact
*interactive*
>>> version
bbc-microbit-classic-gcc@0.2.3 from the public module registry
>>> type(version)
<class 'yotta.lib.registry_access.RegistryThingVersion'>
>>>
now exiting InteractiveConsole...
(Pdb) n
AttributeError: 'RegistryThingVersion' object has no attribute 'truncate'
Got it working by adding the following method to class Version defined in yotta/lib/version.py:
def truncate(self, level):
return self.version.truncate(level)
@psch2 great work, please open a PR and we can check all tests are still good.
@thegecko Would it be possible to get a new release to include 047cff2? I am a new user, just installed 0.19.0, and I'm affected by that bug. Thanks!
I've released a newer version to TestPyPI:
https://test.pypi.org/project/yotta/
Could you try it out and confirm it fixes this issue?
@thegecko It did, thanks!
OK, thanks.
I've released v0.20.0
macOS Mojave 10.14.06 Python 3.7.4 yotta 0.19.0 cmake 3.15.2 ninja 1.9.0 arm-none-eabi-gcc stable 8-2018-q4-major
I'm trying to build https://github.com/lancaster-university/microbit-samples. When I run
I get the output
Any ideas wha is causing this?