Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2791

Fix lang/py3/build.sh to process each argument separately

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.10.0
    • build, python
    • None

    Description

      I ran ./build.sh clean test in the lang/py3 directory and came across the following error:

      $ ./build.sh docker
      sekikn@2241fc3fd5a3:~/avro$ cd lang/py3
      sekikn@2241fc3fd5a3:~/avro/lang/py3$ ./build.sh clean test
      running clean
      removing 'avro_python3.egg-info' (and everything under it)
      Removing /home/sekikn/avro/lang/py3/avro/VERSION.txt
      removing '/home/sekikn/avro/lang/py3/avro/__pycache__' (and everything under it)
      Removing /home/sekikn/avro/lang/py3/avro/HandshakeResponse.avsc
      Removing /home/sekikn/avro/lang/py3/avro/HandshakeRequest.avsc
      removing '/home/sekikn/avro/lang/py3/avro/tests/__pycache__' (and everything under it)
      Removing /home/sekikn/avro/lang/py3/avro/tests/interop.avsc
      running test
      WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
      running egg_info
      creating avro_python3.egg-info
      writing avro_python3.egg-info/PKG-INFO
      writing requirements to avro_python3.egg-info/requires.txt
      writing dependency_links to avro_python3.egg-info/dependency_links.txt
      writing top-level names to avro_python3.egg-info/top_level.txt
      writing manifest file 'avro_python3.egg-info/SOURCES.txt'
      reading manifest file 'avro_python3.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching 'avro/HandshakeRequest.avsc'
      warning: no files found matching 'avro/HandshakeResponse.avsc'
      warning: no files found matching 'avro/VERSION.txt'
      writing manifest file 'avro_python3.egg-info/SOURCES.txt'
      running build_ext
      error: [Errno 2] No such file or directory: '/home/sekikn/avro/lang/py3/avro/VERSION.txt'
      

      This is because the main function is implemented as follows. If the arguments clean test are passed to that function, a single command python3 setup.py clean test is called.
      Instead, it should call setup.py for each argument in the for-loop.

      main() {
      
        (snip)
      
        for target; do
          case "$target" in
            lint) set -- isort "$@";;
            clean|dist|isort|test) :;;
            *) usage; return 1;;
          esac
        done
        python3 setup.py "$@"
      }
      

      Attachments

        Issue Links

          Activity

            People

              sekikn Kengo Seki
              sekikn Kengo Seki
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: