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

Rename and publish plugin #53

Closed
SPlanzer opened this issue Mar 13, 2019 · 4 comments
Closed

Rename and publish plugin #53

SPlanzer opened this issue Mar 13, 2019 · 4 comments
Assignees

Comments

@SPlanzer
Copy link

Background

The package name (linz-data-importer) followed the poor practise of using hyphens. This became an issue when promoting a custom widget via QT Designer to solve #47. The problem was when the python UI code was dynamical generated by PytQ5.uic.loadUi, the statement import x from linz-data-importer.gui.x was output. The hyphens makes this an invalid python import.

To solve this, the package name was renamed to "linz_data_importer" (I note pep8 allows underscores).

Problem
The problem now however is that the plugin can not be loaded to the QGIS plugin server as part of the current repo as it will not allow versions with different names to be loaded.

Solution
It appears the only option available is to rename the plugin and start a 'new' plugin (as far as the QGIS plugin server is concerned).

The plugin will therefore need a new name.

  • LINZ Data Importer v2?

Problems with the solution
I would prefer not to undertake the confusing step of renaming the plugin but am unaware of another solution.

Renaming the plugin will have the below negative outcomes:

  • Old versions and download stats from the previously named plugin will not carry across to the renamed one.
  • Users of the current plugin will not be notified of the existence of a new plugin.
  • The plugin name will no longer directly relate to the source code repository name.
  • having to plugins with the same name will be confusing to users.

Further consideration
Should the code repository be forked and renamed?

@SPlanzer SPlanzer self-assigned this Mar 13, 2019
@SPlanzer SPlanzer pinned this issue Mar 13, 2019
@SPlanzer
Copy link
Author

Having talked with Paolo

it is not possible to change the name of a plugin once uploaded the first version.
I know it can be a hassle. Please check the issues of the Django app. We
are now migrating it to Python 3, it might be the right time to improve
this aspect.

There are two options available:

  • Create a new plugin (on the QGIS plugin server)
  • Find away to not change the package name
    • Do not dynamically generate the ui file on plugin start up via PytQ5.uic.loadUi but manually generate the file via the terminal utility pyuic5 and use import to import the custom widget to get around hyphens in the package name
    • Do not use a custom widget (This will limit plugin functionality)

@SPlanzer
Copy link
Author

SPlanzer commented Mar 14, 2019

The solution to be implemented is to update the sys path

import sys
from os.path import dirname, abspath
sys.path.append(dirname(abspath(__file__)))

This way the promote widget will not need to reference the entire path (with the illegal characters)

@stale
Copy link

stale bot commented Mar 19, 2019

This issue has been automatically marked as stale as there has not been any activity for sometime. The issue will be closed in 5 days if no further activity.

@stale stale bot added the Stale label Mar 19, 2019
@SPlanzer SPlanzer removed the Stale label Mar 21, 2019
@SPlanzer
Copy link
Author

As above renaming to correct poor package name was too difficult.

A new version has been published using the sys.path solution above

@SPlanzer SPlanzer unpinned this issue Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant