Add MANIFEST.in for distributing logging.yml

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura
2019-09-28 16:10:56 +09:00
parent 79eb91492a
commit e8de2e7869
8 changed files with 90 additions and 40 deletions

3
.gitignore vendored
View File

@@ -8,4 +8,5 @@ __pycache__
.tox .tox
.venv .venv
_build _build
ci/*.matrix.gen.yml ci/*.matrix.gen.yml
docs/_build

25
MANIFEST.in Normal file
View File

@@ -0,0 +1,25 @@
include *.rst
include *.txt
include *.cfg
include *.yml
include AUTHORS
include LICENSE
include tox.ini
recursive-include aqt *.yml
recursive-include ci *.py
recursive-include ci *.yml
recursive-include docs *.bat
recursive-include docs *.dia
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.yml
recursive-include docs *.svg
recursive-include docs *.html
recursive-include docs *.txt
recursive-include docs Makefile
recursive-include tests *.conf
recursive-include tests *.cpp
recursive-include tests *.pro
recursive-include tests *.qml
recursive-include tests *.qrc
recursive-include tests *.svg

View File

@@ -20,11 +20,10 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import requests
import traceback
import xml.etree.ElementTree as ElementTree import xml.etree.ElementTree as ElementTree
from logging import getLogger from logging import getLogger
from six import StringIO
import requests
class QtPackage: class QtPackage:

View File

@@ -26,8 +26,8 @@ import logging.config
import os import os
import platform import platform
import sys import sys
import yaml
import yaml
from aqt.archives import QtArchives from aqt.archives import QtArchives
from aqt.installer import QtInstaller from aqt.installer import QtInstaller
@@ -37,24 +37,24 @@ class Cli():
__slot__ = ['parser'] __slot__ = ['parser']
COMBINATION = [ COMBINATION = [
{'os_name': 'linux', 'target': 'desktop', 'arch': 'gcc_64'}, {'os_name': 'linux', 'target': 'desktop', 'arch': 'gcc_64'}, # noqa:E241
{'os_name': 'linux', 'target': 'android', 'arch': 'android_x86'}, {'os_name': 'linux', 'target': 'android', 'arch': 'android_x86'}, # noqa:E241
{'os_name': 'linux', 'target': 'android', 'arch': 'android_armv7'}, {'os_name': 'linux', 'target': 'android', 'arch': 'android_armv7'}, # noqa:E241
{'os_name': 'mac', 'target': 'desktop', 'arch': 'clang_64'}, {'os_name': 'mac', 'target': 'desktop', 'arch': 'clang_64'}, # noqa:E241
{'os_name': 'mac', 'target': 'ios', 'arch': 'ios'}, {'os_name': 'mac', 'target': 'ios', 'arch': 'ios'}, # noqa:E241
{'os_name': 'windows', 'target': 'desktop', 'arch': 'win64_msvc2017_64'}, {'os_name': 'windows', 'target': 'desktop', 'arch': 'win64_msvc2017_64'}, # noqa:E241
{'os_name': 'windows', 'target': 'desktop', 'arch': 'win32_msvc2017'}, {'os_name': 'windows', 'target': 'desktop', 'arch': 'win32_msvc2017'}, # noqa:E241
{'os_name': 'windows', 'target': 'desktop', 'arch': 'win64_msvc2015_64'}, {'os_name': 'windows', 'target': 'desktop', 'arch': 'win64_msvc2015_64'}, # noqa:E241
{'os_name': 'windows', 'target': 'desktop', 'arch': 'win32_msvc2015'}, {'os_name': 'windows', 'target': 'desktop', 'arch': 'win32_msvc2015'}, # noqa:E241
{'os_name': 'windows', 'target': 'desktop', 'arch': 'win64_mingw73'}, {'os_name': 'windows', 'target': 'desktop', 'arch': 'win64_mingw73'}, # noqa:E241
{'os_name': 'windows', 'target': 'desktop', 'arch': 'win32_mingw73'}, {'os_name': 'windows', 'target': 'desktop', 'arch': 'win32_mingw73'}, # noqa:E241
{'os_name': 'windows', 'target': 'desktop', 'arch': 'win64_mingw53'}, {'os_name': 'windows', 'target': 'desktop', 'arch': 'win64_mingw53'}, # noqa:E241
{'os_name': 'windows', 'target': 'desktop', 'arch': 'win32_mingw53'}, {'os_name': 'windows', 'target': 'desktop', 'arch': 'win32_mingw53'}, # noqa:E241
{'os_name': 'windows', 'target': 'winrt', 'arch': 'win64_msvc2017_winrt_x64'}, {'os_name': 'windows', 'target': 'winrt', 'arch': 'win64_msvc2017_winrt_x64'}, # noqa:E241
{'os_name': 'windows', 'target': 'winrt', 'arch': 'win64_msvc2017_winrt_x86'}, {'os_name': 'windows', 'target': 'winrt', 'arch': 'win64_msvc2017_winrt_x86'}, # noqa:E241
{'os_name': 'windows', 'target': 'winrt', 'arch': 'win64_msvc2017_winrt_armv7'}, {'os_name': 'windows', 'target': 'winrt', 'arch': 'win64_msvc2017_winrt_armv7'}, # noqa:E241
{'os_name': 'windows', 'target': 'android', 'arch': 'android_x86'}, {'os_name': 'windows', 'target': 'android', 'arch': 'android_x86'}, # noqa:E241
{'os_name': 'windows', 'target': 'android', 'arch': 'android_armv7'}, {'os_name': 'windows', 'target': 'android', 'arch': 'android_armv7'}, # noqa:E241
] ]
def check_arg_combination(self, qt_version, os_name, target, arch): def check_arg_combination(self, qt_version, os_name, target, arch):
@@ -103,11 +103,11 @@ class Cli():
args.print_help() args.print_help()
exit(1) exit(1)
if output_dir is not None: if output_dir is not None:
QtInstaller(QtArchives(os_name, qt_version, target, arch, mirror=mirror, logging=self.logger), QtInstaller(QtArchives(os_name, qt_version, target, arch, mirror=mirror, logging=self.logger),
logging=self.logger).install(command=sevenzip, target_dir=output_dir) logging=self.logger).install(command=sevenzip, target_dir=output_dir)
else: else:
QtInstaller(QtArchives(os_name, qt_version, target, arch, mirror=mirror, logging=self.logger), QtInstaller(QtArchives(os_name, qt_version, target, arch, mirror=mirror, logging=self.logger),
logging = self.logger).install(command=sevenzip) logging=self.logger).install(command=sevenzip)
sys.stdout.write("\033[K") sys.stdout.write("\033[K")
print("Finished installation") print("Finished installation")
@@ -159,11 +159,11 @@ class Cli():
envconf = os.getenv(env_key, None) envconf = os.getenv(env_key, None)
conf = None conf = None
if args.logging_conf: if args.logging_conf:
conf=args.logging_conf conf = args.logging_conf
elif envconf is not None: elif envconf is not None:
conf = envconf conf = envconf
if conf is None or not os.path.exists(conf): if conf is None or not os.path.exists(conf):
conf=os.path.join(os.path.dirname(__file__), 'logging.yml') conf = os.path.join(os.path.dirname(__file__), 'logging.yml')
with open(conf, 'r') as f: with open(conf, 'r') as f:
log_config = yaml.safe_load(f.read()) log_config = yaml.safe_load(f.read())
logging.config.dictConfig(log_config) logging.config.dictConfig(log_config)

View File

@@ -22,16 +22,18 @@
import functools import functools
import os import os
import py7zr
import requests
import traceback import traceback
import xml.etree.ElementTree as ElementTree import xml.etree.ElementTree as ElementTree
from logging import getLogger from logging import getLogger
from six import StringIO
from multiprocessing.dummy import Pool from multiprocessing.dummy import Pool
from operator import and_ from operator import and_
from subprocess import run from subprocess import run
from six import StringIO
import py7zr
import requests
NUM_PROCESS = 3 NUM_PROCESS = 3
blacklist = ['http://mirrors.ustc.edu.cn', blacklist = ['http://mirrors.ustc.edu.cn',
'http://mirrors.tuna.tsinghua.edu.cn', 'http://mirrors.tuna.tsinghua.edu.cn',
@@ -54,7 +56,6 @@ class QtInstaller:
else: else:
self.logger = getLogger('aqt') self.logger = getLogger('aqt')
@staticmethod @staticmethod
def retrieve_archive(package, path=None, command=None): def retrieve_archive(package, path=None, command=None):
archive = package.archive archive = package.archive

2
docs/requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
sphinx>=1.8
sphinx_rtd_theme

View File

@@ -21,14 +21,7 @@ setup(name='aqtinstall',
author_email='miurahr@linux.com', author_email='miurahr@linux.com',
packages=["aqt"], packages=["aqt"],
install_requires=['requests', 'six', 'py7zr'], install_requires=['requests', 'six', 'py7zr'],
extras_require={ extras_require={'dev': ['pytest', 'pytest-pep8', 'pytest-cov', 'flake8']},
'dev': [
'pytest',
'pytest-pep8',
'pytest-cov',
'flake8'
]
},
scripts=["bin/aqt"], scripts=["bin/aqt"],
classifiers=[ classifiers=[
'Development Status :: 3 - Alpha', 'Development Status :: 3 - Alpha',
@@ -43,5 +36,5 @@ setup(name='aqtinstall',
'Programming Language :: C++', 'Programming Language :: C++',
'Topic :: Software Development', 'Topic :: Software Development',
'Topic :: Software Development :: Libraries', 'Topic :: Software Development :: Libraries',
], ],
) )

29
tox.ini Normal file
View File

@@ -0,0 +1,29 @@
[tox]
envlist = check, docs
[testenv]
[flake8]
ignore =
[testenv:check]
deps =
docutils
check-manifest
flake8
readme-renderer
pygments
isort
skip_install = true
commands =
check-manifest {toxinidir}
flake8 aqt tests setup.py
isort --verbose --check-only --diff --recursive aqt tests setup.py
[testenv:docs]
deps =
-r{toxinidir}/docs/requirements.txt
commands =
sphinx-build {posargs:-E} -b html docs dist/docs
sphinx-build -b linkcheck docs dist/docs