Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snaps packaging #251

Merged
merged 1 commit into from Jul 24, 2017
Merged

Snaps packaging #251

merged 1 commit into from Jul 24, 2017

Conversation

tian2992
Copy link
Contributor

A first version to create a snap package.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9efd53c on tian2992:master into ** on DenisCarriere:master**.

@DenisCarriere
Copy link
Owner

@tian2992 Thanks for the PR, however what's a snap package? and how would this be used? Can you elaborate more on the purpose of snap packages (I must be out of the loop on this topic).

@come-maiz
Copy link
Contributor

Hello @DenisCarriere! Snapcraft is a new packaging format for all Linux distros, that we are developing in Ubuntu. You can read more here: https://snapcraft.io/

Once the snapcraft.yaml is in your master branch, you can just go to https://build.snapcraft.io to automate the continuous delivery of updates to the Ubuntu store.

@DenisCarriere DenisCarriere merged commit fd0e7ad into DenisCarriere:master Jul 24, 2017
@come-maiz
Copy link
Contributor

\o/ thanks for the merge @DenisCarriere.

@tian2992 did this as part of a workshop during a Central American free software conference. Nice work, thanks to you too!

The geocoder name is now registered in the store under @tian2992, which was an exercise we did to learn about publishing. But if you want to start publishing geocoder under your official name, I can make the transfer. @DenisCarriere you just need to fill this form, explaining that you are the original author: https://dashboard.snapcraft.io/dev/snaps/register-name/

pura vida

@tian2992
Copy link
Contributor Author

tian2992 commented Jul 24, 2017 via email

@DenisCarriere
Copy link
Owner

👍 Yes if we could transfer the repo that would be great.

@come-maiz
Copy link
Contributor

Just let me know when you are done with the form, and I can click the button.

@DenisCarriere
Copy link
Owner

Ok, ready whenever you are.
image

@DenisCarriere
Copy link
Owner

image

@come-maiz
Copy link
Contributor

Done. Please let us know if you have any issues with build.snapcraft.io.
And once you have the snap in the edge channel, we can make a call for testing with the Ubuntu community to get more people trying it before making the first stable release.

@DenisCarriere
Copy link
Owner

👍

@DenisCarriere
Copy link
Owner

So these snap packages are mostly for CLI based applications, correct?

@DenisCarriere
Copy link
Owner

Looks like it's built and released, anything else more to do on my side?

image

@come-maiz
Copy link
Contributor

No, there are also GUI snaps. For example, try:

sudo snap install keepassxc

But it is not for libraries. After installing the geocoder snap, only the CLI script can be executed, it can't be imported from a python terminal. It's like we have virtualenv for development, and snaps for deployment.

For your side right now, it only remains to suggest to your early adopters and contributors to give it a try with:

sudo snap install geocoder --edge

Then, when you are happy with the quality of a version and want to make it visible on user searches, you just run:

snapcraft release geocoder <revision> stable

@DenisCarriere
Copy link
Owner

Doesn't seem to recognize the geocode CLI...?

Does it work for you?

$ snap install geocoder --edge --devmode 
geocoder (edge) 1.23.2 from 'deniscarriere' installed
$ geocode
zsh: command not found: geocode

@come-maiz
Copy link
Contributor

The name of the command chosen by Sebastián is geocoder.

The name of the command is a combination of rules between the name and apps fields in the snapcraft.yaml. If you want the command to be geocode, you would have to rename the snap to geocode, or use an alias.

@DenisCarriere
Copy link
Owner

Perfect, thanks, it somewhat works now:

Going to switch it back to Python2 and 🤞 it should work.

This is pretty slick! I'll continue to maintain these builds for future releases and other projects.

$ snap run geocoder "Ottawa, ON"
Traceback (most recent call last):
  File "/snap/geocoder/5/bin/geocode", line 11, in <module>
    sys.exit(cli())
  File "/snap/geocoder/5/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/geocoder/5/lib/python3.5/site-packages/click/core.py", line 676, in main
    _verify_python3_env()
  File "/snap/geocoder/5/lib/python3.5/site-packages/click/_unicodefun.py", line 118, in _verify_python3_env
    'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.  Consult http://click.pocoo.org/python3/for mitigation steps.

This system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:

    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8

Click discovered that you exported a UTF-8 locale
but the locale system could not pick up from it because
it does not exist.  The exported locale is "en_US.UTF-8" but it
is not supported

@come-maiz
Copy link
Contributor

@DenisCarriere you can make sure that the right encoding is before executing the command binary.

Something like this:

command: env LC_ALL=C.UTF-8 LANG=C.UTF-8 bin/geocode

@DenisCarriere
Copy link
Owner

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants