From 38d82dfc82b65822edb24b886c723f96b624f8a6 Mon Sep 17 00:00:00 2001 From: emdee Date: Tue, 13 Feb 2024 18:59:07 +0000 Subject: [PATCH] pyproject.toml --- .rsync.sh | 2 +- Makefile | 9 +++++-- pyproject.toml | 5 ++-- qweechat/debug.py | 2 +- qweechat/qweechat.py | 6 +++-- setup.cfg | 60 ++++++++++++++++++++++++++++++++++++++++++ setup.py.dst | 62 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 138 insertions(+), 8 deletions(-) create mode 100644 setup.cfg create mode 100644 setup.py.dst diff --git a/.rsync.sh b/.rsync.sh index b42e669..7bc1f27 100644 --- a/.rsync.sh +++ b/.rsync.sh @@ -1,6 +1,6 @@ #!/bin/sh -find * -name \*.py | xargs grep -l '[ ]*$' | xargs sed -i -e 's/[ ]*$//' +# find * -name \*.py | xargs grep -l '[ ]*$' | xargs sed -i -e 's/[ ]*$//' rsync "$@" -vax --include \*.py --exclude \*.log --exclude \*.out \ --exclude \*.egg-info --exclude libs --exclude dist --exclude build \ --exclude \*.pyc --exclude .pyl\* --exclude \*~ --exclude \*.so \ diff --git a/Makefile b/Makefile index 6fb6ec7..d1283e7 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,12 @@ pylint: bandit: bandit -r qweechat +rsync:: + bash .rsync.sh + install:: # we install --nodeps because pip is installing stuff we already have in the OS - ${PYTHON_EXE_MSYS} setup.py install \ - --prefix ${PREFIX}/ + ${PIP_EXE_MSYS} --python ${PYTHON_EXE_MSYS} install \ + --no-deps \ + --target ${PREFIX}/lib/python${PYTHON_MINOR}/site-packages/ \ + --upgrade . diff --git a/pyproject.toml b/pyproject.toml index dd1a710..9e84cb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,5 +47,6 @@ version = {attr = "qweechat.version.VERSION"} readme = {file = ["README.md"]} dependencies = {file = ["requirements.txt"]} -#[tool.setuptools.packages.find] -#where = "src" +[tool.setuptools] +packages = ["qweechat"] + diff --git a/qweechat/debug.py b/qweechat/debug.py index 48be08e..de1d4c7 100644 --- a/qweechat/debug.py +++ b/qweechat/debug.py @@ -33,7 +33,7 @@ class DebugDialog(QtWidgets.QDialog): def __init__(self, *args): QtWidgets.QDialog.__init__(*(self,) + args) - self.resize(1024, 768) + self.resize(800, 600) self.setWindowTitle('Debug console') self.chat = ChatTextEdit(debug=True) diff --git a/qweechat/qweechat.py b/qweechat/qweechat.py index 49d7a68..e270362 100644 --- a/qweechat/qweechat.py +++ b/qweechat/qweechat.py @@ -61,7 +61,7 @@ class MainWindow(QtWidgets.QMainWindow): self.config = read() - self.resize(1000, 600) + self.resize(800, 600) self.setWindowTitle(APP_NAME) self.about_dialog = None @@ -523,8 +523,10 @@ class MainWindow(QtWidgets.QMainWindow): else: index = [i for i, b in enumerate(self.buffers) if b.pointer() == next_buffer] - if index: + if len(index): index = index[0] + else: + index = -1 if index < 0: print('Warning: unable to find position for buffer, using end of ' 'list by default') diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..4301811 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,60 @@ +[metadata] +classifiers = + License :: OSI Approved + License :: OSI Approved :: BSD 1-clause + Intended Audience :: Web Developers + Operating System :: Microsoft :: Windows + Operating System :: POSIX :: BSD :: FreeBSD + Operating System :: POSIX :: Linux + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: Implementation :: CPython + +[options] +zip_safe = false +python_requires = ~=3.7 +include_package_data = + "*" = ["*.png"] +package_dir= + =. +packages=find: + +[options.entry_points] +console_scripts = + qweechat = "qweechat:iMain" + +#[options.packages.find] +#where=. + +[easy_install] +zip_ok = false + +[flake8] +jobs = 1 +max-line-length = 88 +ignore = + E111 + E114 + E128 + E225 + E261 + E302 + E305 + E402 + E501 + E502 + E541 + E701 + E702 + E704 + E722 + E741 + F508 + F541 + W503 + W601 diff --git a/setup.py.dst b/setup.py.dst new file mode 100644 index 0000000..9224aca --- /dev/null +++ b/setup.py.dst @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2011-2022 Sébastien Helleu +# +# This file is part of QWeeChat, a Qt remote GUI for WeeChat. +# +# QWeeChat is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# QWeeChat is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with QWeeChat. If not, see . +# + +from setuptools import setup +from qweechat.version import qweechat_version + +DESCRIPTION = 'Qt remote GUI for WeeChat' + +setup( + name='qweechat', + version=qweechat_version(), + description=DESCRIPTION, + long_description=DESCRIPTION, + author='Sébastien Helleu', + author_email='flashcode@flashtux.org', + url='https://weechat.org/', + license='GPL3', + keywords='weechat qt gui', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: X11 Applications :: Qt', + 'Intended Audience :: End Users/Desktop', + 'License :: OSI Approved :: GNU General Public License v3 ' + 'or later (GPLv3+)', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Topic :: Communications :: Chat', + ], + packages=['qweechat', 'qweechat.weechat'], + include_package_data=True, + package_data={'qweechat': ['data/icons/*.png']}, + entry_points={ + 'gui_scripts': [ + 'qweechat = qweechat.qweechat:main', + ], + 'console_scripts': [ + 'qweechat-testproto = qweechat.weechat.testproto:main', + ] + }, + install_requires=[ + 'PyQt5', + ], + zip_safe = False, +)