more sanitising

This commit is contained in:
Casper da Costa-Luis 2020-11-18 22:22:32 +00:00
parent abffb34e47
commit b80490e12c
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
6 changed files with 8 additions and 17 deletions

View File

@ -6,6 +6,7 @@ on:
- cron: '2 1 * * 6' # M H d m w (Saturdays at 1:02)
jobs:
check:
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
name: install
runs-on: ubuntu-latest
steps:

View File

@ -2,22 +2,15 @@
"""
Auto-generate snapcraft.yaml.
"""
from __future__ import print_function
from configparser import ConfigParser
from io import open as io_open
from os import path
from subprocess import check_output
import re
import sys
sys.path.insert(1, path.dirname(path.dirname(__file__)))
import tqdm # NOQA
src_dir = path.abspath(path.dirname(__file__))
cfg = ConfigParser()
cfg.read(path.join(path.dirname(src_dir), 'setup.cfg'))
setup_requires = re.split(
r"[;\s]+", str(cfg["options"].get("setup_requires")), flags=re.M)
snap_yml = r"""name: tqdm
summary: A fast, extensible CLI progress bar
description: |
@ -60,8 +53,7 @@ license: MPL-2.0
parts:
tqdm:
plugin: python
python-packages: {setup_requires}
python-version: python3
python-packages: [disco-py]
source: .
source-commit: '{commit}'
build-packages: [git]
@ -74,7 +66,6 @@ apps:
completer: completion.sh
""".format(
version=tqdm.__version__,
setup_requires=repr(setup_requires),
commit=check_output(['git', 'describe', '--always']).decode('U8').strip())
fname = path.join(path.dirname(src_dir), 'snapcraft.yaml')

View File

@ -115,13 +115,14 @@ distclean:
pre-commit:
# quick sanity checks
@make --no-print-directory testsetup
flake8 -j 8 --count --statistics setup.py tqdm/ tests/ examples/
flake8 -j 8 --count --statistics setup.py .meta/ tqdm/ tests/ examples/
pytest -qq -k "basic_overhead or not (perf or keras or pandas or monitoring)"
prebuildclean:
@+python -c "import shutil; shutil.rmtree('build', True)"
@+python -c "import shutil; shutil.rmtree('dist', True)"
@+python -c "import shutil; shutil.rmtree('tqdm.egg-info', True)"
@+python -c "import shutil; shutil.rmtree('.eggs', True)"
@+python -c "import os; os.remove('tqdm/_dist_ver.py') if os.path.exists('tqdm/_dist_ver.py') else None"
coverclean:
@+python -c "import os; os.remove('.coverage') if os.path.exists('.coverage') else None"
@+python -c "import os, glob; [os.remove(i) for i in glob.glob('.coverage.*')]"
@ -170,9 +171,8 @@ snap:
@make -B snapcraft.yaml
snapcraft
docker:
@make build
@make .dockerignore
@make coverclean
@make clean
docker build . -t tqdm/tqdm
docker tag tqdm/tqdm:latest tqdm/tqdm:$(shell docker run -i --rm tqdm/tqdm -v)
none:

View File

@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=38.6.0", "setuptools_scm"]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]

View File

@ -3,4 +3,3 @@ twine # pymake pypi
argopt # cd wiki && pymake
pydoc-markdown # cd docs && pymake
wheel # setup.py bdist_wheel
setuptools_scm # version

View File

@ -4,7 +4,7 @@ universal = 1
[flake8]
ignore = W503,W504,E722
max_line_length = 80
exclude = .asv,.tox,.ipynb_checkpoints,build,dist,.git,__pycache__
exclude = .asv,.eggs,.tox,.ipynb_checkpoints,build,dist,.git,__pycache__
[tool:pytest]
python_files = tests_*.py
@ -90,7 +90,7 @@ classifiers =
Topic :: Utilities
[options]
setup_requires = setuptools>=38.6.0; setuptools_scm
setup_requires = setuptools>=42; setuptools_scm[toml]>=3.4
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
tests_require = pytest; flake8; coverage
include_package_data = True