From b80490e12cc97bf3cbf7735bbb6d883f68eccda5 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Wed, 18 Nov 2020 22:22:32 +0000 Subject: [PATCH] more sanitising --- .github/workflows/test.yml | 1 + .meta/mksnap.py | 11 +---------- Makefile | 6 +++--- pyproject.toml | 2 +- requirements-dev.txt | 1 - setup.cfg | 4 ++-- 6 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99f7d1e2..4cd02aac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: diff --git a/.meta/mksnap.py b/.meta/mksnap.py index 5feef0b9..337e46b8 100644 --- a/.meta/mksnap.py +++ b/.meta/mksnap.py @@ -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') diff --git a/Makefile b/Makefile index dd196086..82f239da 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/pyproject.toml b/pyproject.toml index c2f3f1b9..3eb7bbcf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] diff --git a/requirements-dev.txt b/requirements-dev.txt index f19dbe0c..f7882f50 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,4 +3,3 @@ twine # pymake pypi argopt # cd wiki && pymake pydoc-markdown # cd docs && pymake wheel # setup.py bdist_wheel -setuptools_scm # version diff --git a/setup.cfg b/setup.cfg index be184f1c..79f44adf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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