microsoft / microsoft/onnxruntime

Update setup.py so developers can install onnxruntime package locally using pip

Open
#12,291 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

Is your feature request related to a problem? Please describe.
Currently, if want to test source code changes on onnxruntime python package. I need to make symbolic link from the pip's site-package/onnxruntime folder to the directory of source code, quantization for example. I wonder if we can update the setup.py or restructure the folder, so developers can locally install onnxruntime package using pip install -e /dir-to-onnxruntime-root

System information
1.12

Describe the solution you'd like
Update the setup.py or restructure the folder, so developers can locally install onnxruntime package using pip install -e /dir-to-onnxruntime-root

Describe alternatives you've considered
Make symbolic link from the pip's site-package/onnxruntime folder to the directory of source code, quantization for example

Additional context
The requirements.txt is just one example, and there are few following issues after renaming requirements.txt.in to requirements.txt

Obtaining file://C:\Users\cjian\Workspaces\onnxruntime
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'

  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\cjian\Workspaces\onnxruntime\onnxruntime\test\python\venv\Scripts\python.exe' 'C:\Users\cjian\Workspaces\onnxruntime\onnxruntime\test\python\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\cjian\AppData\Local\Temp\tmpocosv_3c'
       cwd: C:\Users\cjian\Workspaces\onnxruntime
  Complete output (17 lines):
  Traceback (most recent call last):
    File "C:\Users\cjian\Workspaces\onnxruntime\onnxruntime\test\python\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
      main()
    File "C:\Users\cjian\Workspaces\onnxruntime\onnxruntime\test\python\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\cjian\Workspaces\onnxruntime\onnxruntime\test\python\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\cjian\AppData\Local\Temp\pip-build-env-rdytmgx4\overlay\Lib\site-packages\setuptools\build_meta.py", line 177, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "C:\Users\cjian\AppData\Local\Temp\pip-build-env-rdytmgx4\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
      self.run_setup()
    File "C:\Users\cjian\AppData\Local\Temp\pip-build-env-rdytmgx4\overlay\Lib\site-packages\setuptools\build_meta.py", line 281, in run_setup
      super(_BuildMetaLegacyBackend,
    File "C:\Users\cjian\AppData\Local\Temp\pip-build-env-rdytmgx4\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
      exec(code, locals())
    File "<string>", line 625, in <module>
  FileNotFoundError: Unable to find requirements.txt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting setup.py and requirements.txt, then reproduce the reported pip install -e /dir-to-onnxruntime-root failure and its missing-requirements.txt error. Determine the packaging changes needed for an editable local install; done means the command completes successfully and the source package is usable without a symbolic link.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.