diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 244f8ea..668eb74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/setup-python@v2 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1ef661..1e8b2f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,21 +1,16 @@ repos: - repo: https://github.com/PyCQA/isort - rev: 5.9.1 + rev: 5.9.3 hooks: - id: isort - - repo: https://github.com/python/black - rev: 21.6b0 + - repo: https://github.com/psf/black + rev: 21.9b0 hooks: - id: black language_version: python3 - - repo: https://gitlab.com/pycqa/flake8 + - repo: https://github.com/PyCQA/flake8 rev: 3.9.2 hooks: - id: flake8 - - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.3.2 - hooks: - - id: prettier diff --git a/justfile b/justfile index 2d4bad6..2dbdb56 100644 --- a/justfile +++ b/justfile @@ -7,7 +7,7 @@ default: tag: @if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi - curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "{{version}}"}' https://api.github.com/repos/nschloe/{{name}}/releases + curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "v{{version}}"}' https://api.github.com/repos/nschloe/{{name}}/releases upload: clean @if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi @@ -19,7 +19,7 @@ publish: tag upload clean: @find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf - @rm -rf *.egg-info/ src/*.egg-info/ build/ dist/ .tox/ + @rm -rf *.egg-info/ src/*.egg-info/ build/ dist/ .tox/ node_modules/ dep: npm install diff --git a/package-lock.json b/package-lock.json index ab4e687..b64e339 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,18 +4,19 @@ "requires": true, "packages": { "": { + "name": "tuna", "dependencies": { - "bootstrap": "5.1.0", - "d3": "7.0.1" + "bootstrap": "5.1.2", + "d3": "7.1.1" }, "devDependencies": { - "prettier": "^2.3.2" + "prettier": "^2.4.1" } }, "node_modules/@popperjs/core": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.3.tgz", - "integrity": "sha512-xDu17cEfh7Kid/d95kB6tZsLOmSWKCZKtprnhVepjsSaCij+lM3mItSJDuuHDMbCWTh8Ejmebwb+KONcCJ0eXQ==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz", + "integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==", "peer": true, "funding": { "type": "opencollective", @@ -23,15 +24,15 @@ } }, "node_modules/bootstrap": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.0.tgz", - "integrity": "sha512-bs74WNI9BgBo3cEovmdMHikSKoXnDgA6VQjJ7TyTotU6L7d41ZyCEEelPwkYEzsG/Zjv3ie9IE3EMAje0W9Xew==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.2.tgz", + "integrity": "sha512-me838a7TSEkldKyplkx21dqFm16+9NbH/rCj3Myo+h2cByyjckqV4m0OnS8QBsSDEoBv8R2jHqfulGQXpvM8Bw==", "funding": { "type": "opencollective", "url": "https://opencollective.com/bootstrap" }, "peerDependencies": { - "@popperjs/core": "^2.9.3" + "@popperjs/core": "^2.10.2" } }, "node_modules/commander": { @@ -43,9 +44,9 @@ } }, "node_modules/d3": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/d3/-/d3-7.0.1.tgz", - "integrity": "sha512-74zonD4nAtxF9dtwFwJ3RuoHPh2D/UTFX26midBuMVH+7pRbOezuyLUIb8mbQMuYFlcUXT+xy++orCmnvMM/CA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.1.1.tgz", + "integrity": "sha512-8zkLMwSvUAnfN9pcJDfkuxU0Nvg4RLUD0A4BZN1KxJPtlnCGzMx3xM5cRl4m8fym/Vy8rlq52tl90UF3m91OnA==", "dependencies": { "d3-array": "3", "d3-axis": "3", @@ -83,9 +84,9 @@ } }, "node_modules/d3-array": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.0.1.tgz", - "integrity": "sha512-l3Bh5o8RSoC3SBm5ix6ogaFW+J6rOUm42yOtZ2sQPCEvCqUMepeX7zgrlLLGIemxgOyo9s2CsWEidnLv5PwwRw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.1.1.tgz", + "integrity": "sha512-33qQ+ZoZlli19IFiQx4QEpf2CBEayMRzhlisJHSCsSUbDXv6ZishqS1x7uFVClKG4Wr7rZVHvaAttoLow6GqdQ==", "dependencies": { "internmap": "1 - 2" }, @@ -304,9 +305,9 @@ } }, "node_modules/d3-scale": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.0.tgz", - "integrity": "sha512-foHQYKpWQcyndH1CGoHdUC4PECxTxonzwwBXGT8qu+Drb1FIc6ON6dG2P5f4hRRMkLiIKeWK7iFtdznDUrnuPQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", "dependencies": { "d3-array": "2.10.0 - 3", "d3-format": "1 - 3", @@ -432,17 +433,17 @@ } }, "node_modules/internmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.1.tgz", - "integrity": "sha512-Ujwccrj9FkGqjbY3iVoxD1VV+KdZZeENx0rphrtzmRXbFvkFO88L80BL/zeSIguX/7T+y8k04xqtgWgS5vxwxw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", "engines": { "node": ">=12" } }, "node_modules/prettier": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", - "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -469,15 +470,15 @@ }, "dependencies": { "@popperjs/core": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.3.tgz", - "integrity": "sha512-xDu17cEfh7Kid/d95kB6tZsLOmSWKCZKtprnhVepjsSaCij+lM3mItSJDuuHDMbCWTh8Ejmebwb+KONcCJ0eXQ==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz", + "integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==", "peer": true }, "bootstrap": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.0.tgz", - "integrity": "sha512-bs74WNI9BgBo3cEovmdMHikSKoXnDgA6VQjJ7TyTotU6L7d41ZyCEEelPwkYEzsG/Zjv3ie9IE3EMAje0W9Xew==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.2.tgz", + "integrity": "sha512-me838a7TSEkldKyplkx21dqFm16+9NbH/rCj3Myo+h2cByyjckqV4m0OnS8QBsSDEoBv8R2jHqfulGQXpvM8Bw==", "requires": {} }, "commander": { @@ -486,9 +487,9 @@ "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" }, "d3": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/d3/-/d3-7.0.1.tgz", - "integrity": "sha512-74zonD4nAtxF9dtwFwJ3RuoHPh2D/UTFX26midBuMVH+7pRbOezuyLUIb8mbQMuYFlcUXT+xy++orCmnvMM/CA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.1.1.tgz", + "integrity": "sha512-8zkLMwSvUAnfN9pcJDfkuxU0Nvg4RLUD0A4BZN1KxJPtlnCGzMx3xM5cRl4m8fym/Vy8rlq52tl90UF3m91OnA==", "requires": { "d3-array": "3", "d3-axis": "3", @@ -523,9 +524,9 @@ } }, "d3-array": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.0.1.tgz", - "integrity": "sha512-l3Bh5o8RSoC3SBm5ix6ogaFW+J6rOUm42yOtZ2sQPCEvCqUMepeX7zgrlLLGIemxgOyo9s2CsWEidnLv5PwwRw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.1.1.tgz", + "integrity": "sha512-33qQ+ZoZlli19IFiQx4QEpf2CBEayMRzhlisJHSCsSUbDXv6ZishqS1x7uFVClKG4Wr7rZVHvaAttoLow6GqdQ==", "requires": { "internmap": "1 - 2" } @@ -670,9 +671,9 @@ "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==" }, "d3-scale": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.0.tgz", - "integrity": "sha512-foHQYKpWQcyndH1CGoHdUC4PECxTxonzwwBXGT8qu+Drb1FIc6ON6dG2P5f4hRRMkLiIKeWK7iFtdznDUrnuPQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", "requires": { "d3-array": "2.10.0 - 3", "d3-format": "1 - 3", @@ -765,14 +766,14 @@ } }, "internmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.1.tgz", - "integrity": "sha512-Ujwccrj9FkGqjbY3iVoxD1VV+KdZZeENx0rphrtzmRXbFvkFO88L80BL/zeSIguX/7T+y8k04xqtgWgS5vxwxw==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==" }, "prettier": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", - "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", "dev": true }, "robust-predicates": { diff --git a/package.json b/package.json index 2e02820..be176db 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "tuna", "dependencies": { - "bootstrap": "5.1.0", - "d3": "7.0.1" + "bootstrap": "5.1.2", + "d3": "7.1.1" }, "devDependencies": { - "prettier": "^2.3.2" + "prettier": "^2.4.1" }, "scripts": { - "prettier": "prettier --check README .github tuna/web/static/icicle.js tuna/web/static/tuna.css" + "prettier": "prettier --check README.md .github tuna/web/static/icicle.js tuna/web/static/tuna.css" } } diff --git a/setup.cfg b/setup.cfg index e69721c..0d3165a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = tuna -version = 0.5.8 +version = 0.5.9 author = Nico Schlömer author_email = nico.schloemer@gmail.com description = Visualize Python performance profiles @@ -22,6 +22,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Topic :: Software Development :: User Interfaces Topic :: Utilities keywords = diff --git a/tests/test_tuna.py b/tests/test_tuna.py index e4a98da..c7ba377 100644 --- a/tests/test_tuna.py +++ b/tests/test_tuna.py @@ -1,5 +1,4 @@ import subprocess -import tempfile import time from pathlib import Path @@ -15,10 +14,9 @@ def test_tuna(): # give server time to start up time.sleep(3) p.terminate() - return -def test_importprofile(): +def test_importprofile(tmp_path): content = """ import time: 3 | 22 | c import time: 2 | 15 | b @@ -45,17 +43,16 @@ def test_importprofile(): ], } - with tempfile.TemporaryDirectory() as temp_dir: - filepath = Path(temp_dir) / "test.log" - with open(filepath, "w") as f: - f.write(content) + filepath = tmp_path / "test.log" + with open(filepath, "w") as f: + f.write(content) - out = tuna.read_import_profile(filepath) + out = tuna.read_import_profile(filepath) assert out == ref, ref -def test_importprofile_multiprocessing(): +def test_importprofile_multiprocessing(tmp_path): # when using multiprocessing, you can have seemingly excessive indentation, # see content = """ @@ -99,12 +96,11 @@ def test_importprofile_multiprocessing(): ], } - with tempfile.TemporaryDirectory() as temp_dir: - filepath = Path(temp_dir) / "test.log" - with open(filepath, "w") as f: - f.write(content) + filepath = tmp_path / "test.log" + with open(filepath, "w") as f: + f.write(content) - out = tuna.read_import_profile(filepath) + out = tuna.read_import_profile(filepath) assert out == ref, ref