Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some code quality issues #466

Merged
merged 5 commits into from Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions .deepsource.toml
@@ -0,0 +1,14 @@
version = 1

test_patterns = ["tests/**"]

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"

[[transformers]]
name = "black"
enabled = true
1 change: 1 addition & 0 deletions MANIFEST.in
@@ -1,5 +1,6 @@
graft src
include *.md pipx_demo.gif logo.png LICENSE
include *.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s better spell out the file name explicitly since this may cause other TOML files to be bundled accidentally. But do we need to include the analyser configuration in sdist in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will make it .deepsource.toml`. But I have added this because the Test/lint were failing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is only to prevent test/lint from failing, you can always specifically exclude the file.


exclude get-pipx.py makefile generate_docs.py .flake8 mkdocs.yml noxfile.py .coveragerc
prune templates
Expand Down
8 changes: 4 additions & 4 deletions scripts/migrate_pipsi_to_pipx.py
Expand Up @@ -13,17 +13,17 @@

def main():
if not which("pipx"):
exit("pipx must be installed to migrate from pipsi to pipx")
sys.exit("pipx must be installed to migrate from pipsi to pipx")

if not sys.stdout.isatty():
exit("Must be run from a terminal, not a script")
sys.exit("Must be run from a terminal, not a script")

pipsi_home = os.environ.get("PIPSI_HOME", os.path.expanduser("~/.local/venvs/"))
packages = [p.name for p in Path(pipsi_home).iterdir()]

if not packages:
print("No packages installed with pipsi")
exit(0)
sys.exit(0)

print("Attempting to migrate the following packages from pipsi to pipx:")
for package in packages:
Expand All @@ -34,7 +34,7 @@ def main():
answer = input("Continue? [y/n] ")

if answer == "n":
exit(0)
sys.exit(0)

error = False
for package in packages:
Expand Down
4 changes: 2 additions & 2 deletions src/pipx/commands/common.py
Expand Up @@ -160,7 +160,7 @@ def get_package_summary(
)
exposed_binary_names = sorted(p.name for p in exposed_app_paths)
unavailable_binary_names = sorted(
set(add_suffix(name, suffix) for name in package_metadata.apps)
{add_suffix(name, suffix) for name in package_metadata.apps}
- set(exposed_binary_names)
)
# The following is to satisfy mypy that python_version is str and not
Expand Down Expand Up @@ -290,7 +290,7 @@ def run_post_install_actions(
if venv.safe_to_remove():
venv.remove_venv()

if len(package_metadata.app_paths_of_dependencies.keys()):
if package_metadata.app_paths_of_dependencies.keys():
pnijhara marked this conversation as resolved.
Show resolved Hide resolved
raise PipxError(
f"No apps associated with package {package}. "
"Try again with '--include-deps' to include apps of dependent packages, "
Expand Down