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

Plugin name with spaces are not well detected by QGIS #22

Closed
Gustry opened this issue Aug 4, 2020 · 5 comments · Fixed by #23
Closed

Plugin name with spaces are not well detected by QGIS #22

Gustry opened this issue Aug 4, 2020 · 5 comments · Fixed by #23

Comments

@Gustry
Copy link
Collaborator

Gustry commented Aug 4, 2020

We have a few plugins with a space in their name.
When using the plugins.xml generated by the plugin, we are noticing that QGIS is confused about the name.

For instance, we have this plugin https://github.com/3liz/qgis-veloroutes_voies_vertes-plugin
The plugin is named/located in the veloroutes_voies_vertes directory.

The plugins.xml generated by qgis-plugin-ci will have:

<file_name>veloroutes-voies-vertes.0.2.0.zip</file_name>
<download_url>https://github.com/3liz/qgis-veloroutes_voies_vertes-plugin/releases/download/0.2.0/veloroutes-voies-vertes.0.2.0.zip</download_url>

When I install it using the plugins.xml, QGIS will be confused because QGIS will extract the folder with veloroutes_voies_vertes while QGIS will look for a folder veloroutes-voies-vertes. A warning is raised in the plugin manager saying that the plugin went somewhere but not in the correct directory (because the folder veloroutes-voies-vertes does not exist after extraction).

Don't you have this issue too?
The filename parameter in the plugins.xml should be filled with the correct plugin name IMHO.

@3nids
Copy link
Member

3nids commented Aug 4, 2020

I would suggest to try renaming your src folder accordingly by replacing underscore by dashes? that would be an easy fix.

I don't think this is related to the filename in the XML.

@Gustry
Copy link
Collaborator Author

Gustry commented Aug 5, 2020

I would suggest to try renaming your src folder accordingly by replacing underscore by dashes?

Well, we have many plugins with underscore and I think underscore is better :)

I have checked, you have plugins with underscore as well:
https://github.com/opengisch/qgis-relation-batchinsert
You don't have the issue?

I don't think this is related to the filename in the XML.

I haven't checked in QGIS code, but changing from

<file_name>veloroutes-voies-vertes.0.2.0.zip</file_name>
<download_url>https://URL/veloroutes-voies-vertes.0.2.0.zip</download_url>

to

<file_name>veloroutes_voies_vertes.0.2.0.zip</file_name>
<download_url>https://URL/veloroutes-voies-vertes.0.2.0.zip</download_url>

fixes the issue. (only updating - to _ in the filename, not even in the download URL).
I haven't checked if QGIS is able to update the plugin later.

I just made a quick PR to have a better error message in QGIS : qgis/QGIS#38153

@Gustry
Copy link
Collaborator Author

Gustry commented Aug 5, 2020

I confirm QGIS can update a plugin by changing - to _ only in the filename section.

@3nids
Copy link
Member

3nids commented Aug 5, 2020

I have checked, you have plugins with underscore as well:
https://github.com/opengisch/qgis-relation-batchinsert
You don't have the issue?

I don't use the custom repo for this, I push directly to the official plugin repo.

Actually, I think that the file name is very bad handled in QGIS (putting a dash in front of the version number actually leads to the same error). So it's very well possible that we cannot have dashes at all in the file name.

Can you PR to simple replace dashes by underscores for the XML? How does that sound to you?

@Gustry
Copy link
Collaborator Author

Gustry commented Aug 5, 2020

Actually, I like this comment
https://github.com/opengisch/qgis-plugin-ci/blob/master/qgispluginci/parameters.py#L120
:)

Can you PR to simple replace dashes by underscores for the XML? How does that sound to you?

Yes, sure ;-) Fine for me of course.

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 a pull request may close this issue.

2 participants