NagisaVon commented on PR #22400:
URL: https://github.com/apache/beam/pull/22400#issuecomment-1198487639

   > Hey @NagisaVon, you can just run these two commands in your sdks/python 
directory:
   > 
   > ```
   > ../../gradlew lint       # Runs several linter checks
   > tox -e py3-yapf    # Runs code formatting
   > ```
   > 
   > (you would need to install tox if you don't have it: `pip install tox`) 
More information here: 
https://cwiki.apache.org/confluence/display/BEAM/Python+Tips#PythonTips-LintandFormattingChecks
   
   Hi @ahmedabu98, I've followed the guide to setup local develop env and was 
trying to run lint, but encountered the following error: 
   
   ```bash
   python git:(mongodb-custom-write) ✗ sudo ../../gradlew lint                  
    
   Password:
   Configuration on demand is an incubating feature.
   
   > Task :sdks:python:test-suites:tox:py37:lintPy37
   GLOB sdist-make: 
/Users/von/Documents/GradientHealth/Code/beam/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/setup.py
   py37-lint recreate: 
/Users/von/Documents/GradientHealth/Code/beam/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/target/.tox-py37-lint/py37-lint
   py37-lint installdeps: -rbuild-requirements.txt, astroid<2.9,>=2.8.0, 
pycodestyle==2.8.0, pylint==2.11.1, isort==4.2.15, flake8==4.0.1
   py37-lint inst: 
/Users/von/Documents/GradientHealth/Code/beam/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/target/.tox-py37-lint/.tmp/package/1/apache-beam-2.41.0.dev0.zip
   ERROR: invocation failed (exit code 1), logfile: 
/Users/von/Documents/GradientHealth/Code/beam/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/target/.tox-py37-lint/py37-lint/log/py37-lint-2.log
   ================================== log start 
===================================
   WARNING: The directory '/Users/von/Library/Caches/pip' or its parent 
directory is not owned or is not writable by the current user. The cache has 
been disabled. Check the permissions and owner of that directory. If executing 
pip with sudo, you should use sudo's -H flag.
   Processing ./target/.tox-py37-lint/.tmp/package/1/apache-beam-2.41.0.dev0.zip
     Preparing metadata (setup.py): started
     Preparing metadata (setup.py): finished with status 'error'
     error: subprocess-exited-with-error
     
     × python setup.py egg_info did not run successfully.
     │ exit code: 1
     ╰─> [12 lines of output]
         /private/tmp/pip-req-build-7oirj20h/setup.py:95: DeprecationWarning: 
distutils Version classes are deprecated. Use packaging.version instead.
           if StrictVersion(_PIP_VERSION) < StrictVersion(REQUIRED_PIP_VERSION):
         Traceback (most recent call last):
           File "<string>", line 36, in <module>
           File "<pip-setuptools-caller>", line 34, in <module>
           File "/private/tmp/pip-req-build-7oirj20h/setup.py", line 164, in 
<module>
             generate_protos_first()
           File "/private/tmp/pip-req-build-7oirj20h/setup.py", line 134, in 
generate_protos_first
             gen_protos.generate_proto_files()
           File "/private/tmp/pip-req-build-7oirj20h/gen_protos.py", line 476, 
in generate_proto_files
             raise RuntimeError(error_msg)
         RuntimeError: Not in apache git tree, unable to find proto definitions.
         [end of output]
     
     note: This error originates from a subprocess, and is likely not a problem 
with pip.
   error: metadata-generation-failed
   
   × Encountered error while generating package metadata.
   ╰─> See above for output.
   
   note: This is an issue with the package mentioned above, not pip.
   hint: See above for details.
   
   =================================== log end 
====================================
   ___________________________________ summary 
____________________________________
   ERROR:   py37-lint: InvocationError for command 
/Users/von/Documents/GradientHealth/Code/beam/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/target/.tox-py37-lint/py37-lint/bin/python
 target/.tox-py37-lint/py37-lint/bin/pip install --retries 10 --exists-action w 
'/Users/von/Documents/GradientHealth/Code/beam/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/target/.tox-py37-lint/.tmp/package/1/apache-beam-2.41.0.dev0.zip[test,dataframe]'
 (exited with code 1)
   
   > Task :sdks:python:test-suites:tox:py37:lintPy37 FAILED
   
   FAILURE: Build failed with an exception.
   
   * What went wrong:
   Execution failed for task ':sdks:python:test-suites:tox:py37:lintPy37'.
   > Process 'command 'sh'' finished with non-zero exit value 1
   ```
   
   Can you help me with this? Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to