diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ded5643..820085c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,7 +52,7 @@ pylint: needs: [] before_script: - pip install pylint pylint-exit anybadge - - pip install -e .[dev] + - pip install -e .[dev,pyqt6] script: - mkdir ./pylint - pylint ./bec_widgets --output-format=text --output=./pylint/pylint.log | tee ./pylint/pylint.log || pylint-exit $? @@ -111,7 +111,7 @@ tests: - apt-get update - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3 - pip install -e ./bec/bec_lib[dev] - - pip install -e .[dev] + - pip install -e .[dev,pyqt6] - coverage run --source=./bec_widgets -m pytest -v --junitxml=report.xml --random-order --full-trace ./tests/unit_tests - coverage report - coverage xml @@ -164,7 +164,7 @@ end-2-end-conda: - pip install -e ./bec_lib[dev] - pip install -e ./bec_ipython_client[dev] - cd ../ - - pip install -e .[dev] + - pip install -e .[dev,pyqt6] - cd ./tests/end-2-end - pytest --start-servers --flush-redis --random-order diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..7aa56e32 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,57 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "bec_widgets" +version = "0.52.1" +description = "BEC Widgets" +requires-python = ">=3.10" +classifiers = [ + "Development Status :: 3 - Alpha", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", +] +dependencies = [ + "pydantic", + "qtconsole", + "jedi", + "qtpy", + "pyqtgraph", + "bec_lib", + "zmq", + "h5py", + "pyqtdarktheme", + "black", +] + + +[project.optional-dependencies] +dev = [ + "pytest", + "pytest-random-order", + "pytest-timeout", + "coverage", + "pytest-qt", + "isort", + "fakeredis", +] +pyqt5 = ["PyQt5>=5.9"] +pyqt6 = ["PyQt6>=6.7"] + +[project.urls] +"Bug Tracker" = "https://gitlab.psi.ch/bec/bec_widgets/issues" +Homepage = "https://gitlab.psi.ch/bec/bec_widgets" + +[tool.hatch.build.targets.wheel] +include = ["*"] + +[tool.black] +line-length = 100 +skip-magic-trailing-comma = true + +[tool.isort] +profile = "black" +line_length = 100 +multi_line_output = 3 +include_trailing_comma = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a4d1dd87..00000000 --- a/setup.cfg +++ /dev/null @@ -1,21 +0,0 @@ -[metadata] -name = bec_widgets -description = BEC Widgets -long_description = file: README.md -long_description_content_type = text/markdown -url = https://gitlab.psi.ch/bec/bec-widgets -project_urls = - Bug Tracker = https://gitlab.psi.ch/bec/bec-widgets/issues -classifiers = - Programming Language :: Python :: 3 - Development Status :: 3 - Alpha - Topic :: Scientific/Engineering - -[options] -package_dir = - = . -packages = find: -python_requires = >=3.10 - -[options.packages.find] -where = . diff --git a/setup.py b/setup.py deleted file mode 100644 index 619908e1..00000000 --- a/setup.py +++ /dev/null @@ -1,56 +0,0 @@ -# pylint: disable= missing-module-docstring -from setuptools import find_packages, setup - -__version__ = "0.52.1" - -# Default to PyQt6 if no other Qt binding is installed -QT_DEPENDENCY = "PyQt6>=6.7" - -# pylint: disable=unused-import -try: - import PyQt5 -except ImportError: - pass -else: - QT_DEPENDENCY = "PyQt5>=5.9" - -if __name__ == "__main__": - setup( - install_requires=[ - "pydantic", - "qtconsole", - QT_DEPENDENCY, - "jedi", - "qtpy", - "pyqtgraph", - "bec_lib", - "zmq", - "h5py", - "pyqtdarktheme", - "black", - ], - extras_require={ - "dev": [ - "pytest", - "pytest-random-order", - "pytest-timeout", - "coverage", - "pytest-qt", - "black", - "isort", - "fakeredis", - ], - "pyqt5": ["PyQt5>=5.9"], - "pyqt6": ["PyQt6>=6.7"], - }, - version=__version__, - packages=find_packages(), - include_package_data=True, - package_data={ - "": [ - "*.ui", - "*.yaml", - "*.png", - ] - }, - )