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

Allow forcing the qgis version #45

Open
dmarteau opened this issue Oct 24, 2022 · 6 comments
Open

Allow forcing the qgis version #45

dmarteau opened this issue Oct 24, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@dmarteau
Copy link
Member

dmarteau commented Oct 24, 2022

When running qgis-plugin manager without qgis framework installed it use an arbitrary default qgis version which does really not make sens in this context.

In this case it would be more appropriate to let the user specify the qgis version with an appropriate option (i.e --qgis-version X.YZ) for all commands fetching remote infos (search, update, ....)

@dmarteau dmarteau added the enhancement New feature or request label Oct 24, 2022
@Gustry
Copy link
Member

Gustry commented Oct 25, 2022

You can already force it by writing in the sources.list in "a manual way" :

echo "https://plugins.qgis.org/plugins/plugins.xml?qgis=3.4" > /your/sources.list

Then indeed, we would have a warning saying your version is hardcoded.

@laurentj
Copy link

laurentj commented Oct 25, 2022

You can already force it by writing in the sources.list in "a manual way" :

It doesn't work as I could expect.

I have almost the same issue. Although Qgis 3.10 or Qgis 3.16, and python3-qgis are installed globally (with debian/qgis packages), it replaces [VERSION] by '3.22'. It seems it has difficulties to detect the version

If I set the version into the sources.list, we have this message

our https://plugins.qgis.org remote is not using a dynamic QGIS version.
Instead of 'https://plugins.qgis.org/plugins/plugins.xml?qgis=3.10'
in your 'sources.list' file, you should have 'https://plugins.qgis.org/plugins/plugins.xml?qgis=[VERSION]'

Can you remove the file sources.list ? 'qgis-plugin-manager init' will regenerate it using dynamic QGIS version if QGIS is well configured.
This is only a warning, the process will continue with the hardcoded QGIS version : 3.22

The latest sentence is very very confusing. (no, i don't want the process will continue with 3.22, I indicated 3.10, it should continue with 3.10).

And the whole text does not make sens when I set myself the source.list, when I know what I'm doing. This is my ansible script which both install Qgis and setup the source.list, so the version given into the source.list is the same as the version of the installed Qgis. So it produces warnings that are not relevant here, and make the detection of real warning more difficult.

From my point of view, this kind of message should be hidden except if we give a flag like --explain, --advice or --enable-auto-discovering-version or else.. Or perhaps we should having the contrary, a flag like --disable-auto-version, or --no-advice or --I-know-what-I-am-doing-show-me-only-real-issues-please :-)

@laurentj
Copy link

To sum up, I think we should have a flag to disable automatic discovering of the version. Any software that offer features that guess something, should have a way to disable these features, as there could be cases where it does not work well.

I propose

  • --disable-version-discovering : it disable discovering version. If the url into source.list has a [VERSION], ends with an error
  • --qgis-version=3.16. We can keep [VERSION] into the URL, and it disables version discovering. If the url has no [VERSION], ends with an error

@laurentj
Copy link

Or we could have a sub-command check, that tries to guess the version, and displays warnings etc. And automatic version discovering is completely disabled into other commands.

@dmarteau
Copy link
Member Author

You can already force it by writing in the sources.list in "a manual way"

That's not very convenient, especially since the source.list template [VERSION] is then remplaced on the fly by the version hardcoded in the python code.

Amha, an option at the command line is far better that an hardcoded arbitrary value.

@Gustry
Copy link
Member

Gustry commented Oct 27, 2022

Amha, an option at the command line is far better that an hardcoded arbitrary value.

@dmarteau, Yes, I totally agree, I was just giving a quick tip to achieve it with the current state of the code.

@laurentj :

It doesn't work as I could expect.

The latest sentence is very very confusing. (no, i don't want the process will continue with 3.22, I indicated 3.10, it should continue with 3.10).

Indeed, I took this as a bug. It has been fixed in c56b31d

There isn't any QGIS default version involved when installing / upgrading.
For now : any remotes having [VERSION], QGIS version detection must work otherwise it will fail. But if the remote doesn't have the token such as https://plugins.qgis.org/plugins/plugins.xml?qgis=3.10, the process will continue.

I let the ticket open for further updates.

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

No branches or pull requests

3 participants