PySideUp
This repository contains PySideUp, a tool for converting PySide2 code to PySide6. The conversion updates imports, changes outdated components, and ensures your project is compatible with PySide6.
Features
- Automatic Import Update: Converts PySide2 imports to PySide6 equivalents.
- Wildcard Handling: Converts wildcard imports to explicitly imported components.
Installation
You can install PySideUp from PyPI:
pip install pysideup
Usage
To convert a PySide2 file to PySide6, use the pysideup command:
pysideup <directory_path>
You can also specify directories to exclude using --exclude.
Example Conversions
Before Conversion (PySide2)
from PySide2.QtWidgets import QWidget, QVBoxLayout, QAction
from PySide2.QtGui import QIcon
class TestWidget(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("Test with QAction")
layout = QVBoxLayout()
self.setLayout(layout)
action = QAction("Test Action", self)
self.setWindowIcon(QIcon())
After Conversion (PySide6)
from PySide6.QtWidgets import QWidget, QVBoxLayout
from PySide6.QtGui import QAction, QIcon
class TestWidget(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("Test with QAction")
layout = QVBoxLayout()
self.setLayout(layout)
action = QAction("Test Action", self)
self.setWindowIcon(QIcon())
Running Unit Tests
Unit tests are provided to ensure that the conversion works as expected. To run the tests, execute:
python -m unittest discover
The tests cover various cases, including multiple imports, wildcard imports, and aliased imports.
Contributing
Contributions are welcome! Feel free to submit issues or pull requests for improvements or bug fixes.
License
This project is licensed under the MIT License.
Metadata
Release files for pysideup 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pysideup-1.0.1.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pysideup-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.9 kB
Release files / pysideup-1.0.1.tar.gz
| Download URL | pysideup-1.0.1.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
347d0337fd3fc29ca6f197d6c16b44eb0cd44adeee7c56c133f5430b001f94c3
|
|
BLAKE2b-256 checksum How to use checksums |
8cd96a05a8dc8be3bb22129e6e1b5b1727576b8372223e43376d3f3378f4a572
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3
|
Release files / pysideup-1.0.1-py3-none-any.whl
| Download URL | pysideup-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76146dcc5284625b3f9c215cb638286530c79cc6566569ea45123da6031cc14d
|
|
BLAKE2b-256 checksum How to use checksums |
3917b2b783d9e6f06f7ba59cae59c86d16b14652f26267d76e5d33480d888ee4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3
|