python package not updating during snap creation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
When I run `snapcraft` it creates a snap package.
After I fixed the bug/changed the code I run the `snapcraft` command again but the python package that I build is still in the old version.
First time I run
```
Collecting TermCheat
Installing collected packages: TermCheat
Successfully installed TermCheat-0.1.8
/root/parts/
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-
```
After I update the version in the `setup.py` file the `snapcraft` command does not build the python package again
```
Launching a VM.
Skipping pull python-wrapper (already ran)
Skipping pull term-cheat (already ran)
Skipping build python-wrapper (already ran)
Skipping build term-cheat (already ran)
Skipping stage python-wrapper (already ran)
Skipping stage term-cheat (already ran)
Skipping prime python-wrapper (already ran)
Skipping prime term-cheat (already ran)
Determining the version from the project repo (version: git).
The version has been set to '0+git.
The requested action has already been taken. Consider
specifying parts, or clean the steps you want to run again.
Snapping 'term-cheat' /
Snapped term-cheat_
```
The I set the `source-type:` from `git` to `local` a new version builds
```
parts:
term-cheat:
plugin: python
source-type: local
```
`snapcraft` output
```
Installing collected packages: TermCheat
Successfully installed TermCheat-0.1.9
/root/parts/
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
```
When now change `setup.py` again and run `snapcraft` a second time I get the following error
```
Successfully built TermCheat
ERROR: You must give at least one requirement to install (maybe you meant "pip install /root/parts/
Failed to run '/root/
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
An error occurred when trying to execute 'sudo -i snapcraft snap' with 'multipass': returned exit code 2.
(term-cheat)
```
Now I set the `source-type` in the `snapcraft.yaml` back to git and it builds the package again but uses an old version
```
Successfully installed TermCheat-0.1.8
/root/parts/
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-
```
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 removed the complete multipass vm and the snapcraft app, no change everything reinstalls but the cached version of the package is used.
The only method I found is to switch between `git` and `local` as `source-type`, so I can build the package once.
I would also love to know where the package is cached. I was digging around for a while but could not find out where the cache is so I could clean it manually.
Ah almost forgot the most important information. The project is
https:/ /github. com/select/ term-cheat
my `snapcraft.yaml`
``` cheat.logo. svg packages:
name: term-cheat
version: git
summary: Collect and find termial commands.
description: |
TermCheat is a searchable library of commands that you can copy remix and extend.
icon: img/term-
grade: stable
confinement: classic
base: core18
parts:
term-cheat:
plugin: python
python-version: python3
source: .
source-type: git
python-
- urwid
- fuzzywuzzy
- pyyaml
- appdirs
- python-Levenshtein
python-wrapper:
plugin: dump
source: bin
stage:
- term-cheat-app
prime:
- term-cheat-app
apps:
term-cheat:
command: term-cheat-app
```