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

python -m darker doesn't work #31

Closed
akaihola opened this issue Jul 25, 2020 · 3 comments
Closed

python -m darker doesn't work #31

akaihola opened this issue Jul 25, 2020 · 3 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers
Milestone

Comments

@akaihola
Copy link
Owner

The README.rst file states:

Alternatively, you can invoke the module directly through the python executable, which may be preferable depending on your setup. Use python -m darker instead of darker in that case.

This is actually not true:

$ python -m darker --help
/tmp/darker-test-venv/bin/python: No module named darker

This should either be fixed or removed from documentation.

@akaihola akaihola added bug Something isn't working documentation Improvements or additions to documentation labels Jul 25, 2020
@akaihola akaihola added this to the 1.1.0 milestone Jul 25, 2020
@akaihola akaihola added the good first issue Good for newcomers label Jul 25, 2020
@Mystic-Mirage
Copy link
Collaborator

Works for me

$ python -m darker --help
usage: __main__.py [-h] [--diff] [-i] [-c PATH] [-v] [-q] [--version] [-S]
                   [-l LINE_LENGTH]
                   [src [src ...]]

Re-format Python source files by using
- `isort` to sort Python import definitions alphabetically within logical
   sections
- `black` to re-format code changed since the last Git commit

positional arguments:
  src

optional arguments:
  -h, --help            show this help message and exit
  --diff                Don't write the files back, just output a diff for
                        each file on stdout
  -i, --isort           Also sort imports using the `isort` package
  -c PATH, --config PATH
                        Ask `black` and `isort` to read configuration from
                        PATH.
  -v, --verbose         Show steps taken and summarize modifications
  -q, --quiet           Reduce amount of output
  --version             Show the version of `darker`
  -S, --skip-string-normalization
                        Don't normalize string quotes or prefixes
  -l LINE_LENGTH, --line-length LINE_LENGTH
                        How many characters per line to allow [default: 88]

@CorreyL
Copy link
Collaborator

CorreyL commented Jul 26, 2020

(venv) λ pip install darker
Collecting darker
  Downloading https://files.pythonhosted.org/packages/09/b6/3ba825126169f2ae860a6cb19b05db23b5304f801f0ebadfceadbc0aa891/darker-1.0.0-py3-none-any.whl
Collecting black (from darker)
  Using cached https://files.pythonhosted.org/packages/fd/bb/ad34bbc93d1bea3de086d7c59e528d4a503ac8fe318bd1fa48605584c3d2/black-19.10b0-py36-none-any.whl
Collecting pathspec<1,>=0.6 (from black->darker)
  Using cached https://files.pythonhosted.org/packages/5d/d0/887c58853bd4b6ffc7aa9cdba4fc57d7b979b45888a6bd47e4568e1cf868/pathspec-0.8.0-py2.py3-none-any.whl
Collecting typed-ast>=1.4.0 (from black->darker)
  Using cached https://files.pythonhosted.org/packages/2a/e3/ec45191e05718c0b686fbedf95620c650f185fa92dfc3b12ee9db90e0b4c/typed_ast-1.4.1-cp38-cp38-win_amd64.whl
Collecting attrs>=18.1.0 (from black->darker)
  Using cached https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting appdirs (from black->darker)
  Using cached https://files.pythonhosted.org/packages/3b/00/2344469e2084fb287c2e0b57b72910309874c3245463acd6cf5e3db69324/appdirs-1.4.4-py2.py3-none-any.whl
Collecting regex (from black->darker)
  Downloading https://files.pythonhosted.org/packages/8a/09/97545f6d0695243cba094bb7a4f9c86483acea1b89ab8686db30d1910b47/regex-2020.7.14-cp38-cp38-win_amd64.whl (264kB)
     |████████████████████████████████| 266kB 652kB/s
Collecting toml>=0.9.4 (from black->darker)
  Using cached https://files.pythonhosted.org/packages/9f/e1/1b40b80f2e1663a6b9f497123c11d7d988c0919abbf3c3f2688e448c5363/toml-0.10.1-py2.py3-none-any.whl
Collecting click>=6.5 (from black->darker)
  Using cached https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl
Installing collected packages: pathspec, typed-ast, attrs, appdirs, regex, toml, click, black, darker
Successfully installed appdirs-1.4.4 attrs-19.3.0 black-19.10b0 click-7.1.2 darker-1.0.0 pathspec-0.8.0 regex-2020.7.14 toml-0.10.1 typed-ast-1.4.1
WARNING: You are using pip version 19.2.3, however version 20.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

(venv) λ python -m darker --help
usage: __main__.py [-h] [--diff] [-i] [-c PATH] [-v] [-q] [--version] [-S] [-l LINE_LENGTH] [src [src ...]]

Re-format Python source files by using
- `isort` to sort Python import definitions alphabetically within logical sections
- `black` to re-format code changed since the last Git commit

Please run `pip install 'darker[isort]'` to enable sorting of import definitions

positional arguments:
  src

optional arguments:
  -h, --help            show this help message and exit
  --diff                Don't write the files back, just output a diff for each file on stdout
  -i, --isort           Also sort imports using the `isort` package. Please run `pip install 'darker[isort]'` to
                        enable usage of this option.
  -c PATH, --config PATH
                        Ask `black` and `isort` to read configuration from PATH.
  -v, --verbose         Show steps taken and summarize modifications
  -q, --quiet           Reduce amount of output
  --version             Show the version of `darker`
  -S, --skip-string-normalization
                        Don't normalize string quotes or prefixes
  -l LINE_LENGTH, --line-length LINE_LENGTH
                        How many characters per line to allow [default: 88]
(venv) λ python --version
Python 3.8.3

For what it's worth.

@akaihola
Copy link
Owner Author

akaihola commented Jul 30, 2020

Indeed now works for me, too. I have no idea what I did differently back when I got that error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants