How can I update my package?


#1

When I run snapcraft it creates a snap package.

I then installed the package with sudo snap install --classic --dangerous *.snap

After I fixed the bug I run the snapcraft command again it will creates another snap with dirty in the name.

I then removed the package with sudo snap remove term-cheat and install the dirty package.

I now expected that the app is updated, but it is not, it’s still returning the same error (some problem in my python package, maybe this is relevant?)

When I run snapcraft clean it removes all installed packages in the vm and I have to reinstall it but it does not update my package. I am confused to what is the right way to update and test a package.


#2

The dirty in the name is due to using version: git. The version string is generated based on the git revision. However if snapcraft detects that there’s additional files which are not part of the commit (possibly your updated snapcraft.yaml?) then it will tag dirty on the end. If you commit your changes, that will go away.

It sounds like there’s some other issue with the snap? Do you have a link to a repo or can you paste the yaml so we can help further?


#3

Here is the repo https://github.com/select/term-cheat


#4

Hm, fails towards the end of the build here…

Successfully built TermCheat urwid pyyaml python-Levenshtein
Looking in links: /root/parts/term-cheat/python-packages
Collecting urwid
Collecting appdirs
Collecting TermCheat
Collecting fuzzywuzzy
Collecting PyYAML
Collecting python_Levenshtein
Installing collected packages: urwid, appdirs, TermCheat, fuzzywuzzy, PyYAML, python-Levenshtein
Successfully installed PyYAML-3.13 TermCheat-0.1.4 appdirs-1.4.3 fuzzywuzzy-0.17.0 python-Levenshtein-0.12.0 urwid-2.0.1
/root/parts/term-cheat/install/usr/bin/python3 setup.py --no-user-cfg install --single-version-externally-managed --user --record install.txt
/root/parts/term-cheat/install/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'entry_points'
  warnings.warn(msg)
/root/parts/term-cheat/install/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --single-version-externally-managed not recognized
Staging python-wrapper 
Staging term-cheat 
Priming python-wrapper 
Priming term-cheat 
Determining the version from the project repo (version: git).
The version has been set to '0+git.3ce6807'
Snapping 'term-cheat' \                                                                                                                                       
Snapped term-cheat_0+git.3ce6807_amd64.snap

Might need some help from @sergiusens


#5

hey there my account was locked so I could not answer

I think I have an idea, I had some problems before updating the python modules in my package, and only sometimes saw in the snapcraft output that the libs were updated. Among the libs there was also my python module. When I run it now I do not see that the python modules are updated, this might be the reason why my code does not change.

Now I have an idea to work around it but I would love to know how I can update the python modules in the vm.


#6

this is new, or I missed it, for me a package was successfully created


#7

OK I finally made it work. If I change install_requires in setup.py nothing happens. I then copied the list into the snapcraft.yaml

parts:
  term-cheat:
    python-packages:
      - urwid
      - fuzzywuzzy
      - pyyaml
      - appdirs
      - python-Levenshtein

when I did this the snapcraft app detected a change and rebuild the package. I can now add a fake value to the python-packages: list build once with an error and then remove the fake value and the build process starts again and calls the setup script again.

I guess I should file an error report somewhere, maybe the python plugin? Not sure though whos fault it is to not detect the change.


#8

Well unfortunately this strategy only worked once, after using this again my package was not updated anymore.


#9

After trying for several hour I found out that in the pull stage new code is never pulled in to the parts/[myapp]/src. I only see an old cached version in there. I tried snapcraft clean snapcraft clean myapp, deleting the directory in the vm and many other things but without success the old code is always copied back and used in building the package.


#10

I think I finally found a way to rebuild the package. If I comment out the source-type line in my snapcraft.yaml the package builds once on the second build there is an error. Commenting in the line builds the package with the old code again, but commenting out the line builds the package with the latest code.


#11

Please file one at http://bugs.launchpad.net/snapcraft/+filebug with as much information you can to reproduce, that would ensure a more expedited resolution to the problem.


#12

I finally go around to create the issue: https://bugs.launchpad.net/snapcraft/+bug/1815358