Skip to content
This repository has been archived by the owner on Oct 7, 2023. It is now read-only.

Commit

Permalink
Version 0.1.4 (#10)
Browse files Browse the repository at this point in the history
* bump to v0.1.4; codecov in CI

* add env vars to codecov upload

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tweak coverage settings, add codecov badge to README.md

* turns out "hi" is a perfectly valid two-character fragment of a 30-character random string...

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
JoshKarpel and pre-commit-ci[bot] authored Nov 7, 2020
1 parent ba894d8 commit e932e62
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 21 deletions.
23 changes: 23 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[run]

branch = True

source =
dis_cli
tests/

[report]

exclude_lines =
pragma: no cover
pragma: unlikely

def __repr__
if self\.debug

raise AssertionError
raise NotImplementedError

if 0:
if False:
if __name__ == .__main__.:
11 changes: 10 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:

runs-on: ${{ matrix.platform }}

env:
PLATFORM: ${{ matrix.platform }}
PYTHON_VERSION: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -25,4 +29,9 @@ jobs:
- name: Install package
run: pip install .[tests]
- name: Run tests
run: pytest tests/
run: pytest --cov --cov-report=xml tests/
- uses: codecov/codecov-action@v1
with:
env_vars: PLATFORM,PYTHON_VERSION
fail_ci_if_error: true
verbose: true
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,3 @@ repos:
rev: 5.6.4
hooks:
- id: isort
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.782
# hooks:
# - id: mypy
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# dis-cli

![PyPI](https://img.shields.io/pypi/v/dis-cli)

[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/JoshKarpel/dis-cli/master.svg)](https://results.pre-commit.ci/latest/github/JoshKarpel/dis-cli/master)
[![codecov](https://codecov.io/gh/JoshKarpel/dis-cli/branch/master/graph/badge.svg?token=Y4LLQ82PZ1)](https://codecov.io/gh/JoshKarpel/dis-cli)

`dis-cli` is a command line tool for displaying Python source and bytecode.

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ include = "\\.pyi?$"

[tool.isort]
known_third_party = ["click", "pytest", "rich", "setuptools"]
profile = "black"
line_length = 100
multi_line_output = "VERTICAL_HANGING_INDENT"
include_trailing_comma = true

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = dis_cli
version = 0.1.3
version = 0.1.4
description = A tool to inspect disassembled Python code on the command line.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down Expand Up @@ -41,6 +41,7 @@ console_scripts =
[options.extras_require]
tests =
pytest>=6
pytest-cov==2.10.1

[mypy]
files = dis_cli.py, tests/*.py
Expand Down
16 changes: 3 additions & 13 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

import dis_cli

USED_FILENAMES = set()
FILENAME_LENGTH = 30


@pytest.fixture
def filename() -> str:
Expand All @@ -24,17 +21,10 @@ def filename() -> str:
Without this, if we run the CLI on two modules with different contents but the same filename during a test session,
the second run will see the contents of the first module.
"""
name = "".join(random.choices(string.ascii_letters, k=FILENAME_LENGTH))

while name in USED_FILENAMES:
name = "".join(random.choices(string.ascii_letters, k=FILENAME_LENGTH))

USED_FILENAMES.add(name)
return "_".join(random.choices(string.ascii_uppercase, k=30))

return name


@pytest.fixture
@pytest.fixture(scope="session")
def runner() -> CliRunner:
return CliRunner()

Expand All @@ -56,7 +46,7 @@ def invoke_with_debug(runner: CliRunner, cli, *args, **kwargs) -> Result:
return result


@pytest.fixture
@pytest.fixture(scope="session")
def cli(runner):
return functools.partial(invoke_with_debug, runner, dis_cli.cli)

Expand Down

0 comments on commit e932e62

Please sign in to comment.