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

Align setup.py and setup.cfg #181

Merged
merged 4 commits into from Nov 23, 2022

Conversation

echarles
Copy link
Member

Fixes #135

@echarles echarles added the bug Something isn't working label Nov 15, 2022
@blink1073
Copy link
Member

I'd recommend the other way around - remove the corresponding fields from setup.py.

@echarles
Copy link
Member Author

I have migrated some content of setup.py to setup.cfg and can not install the python package anymore

pip install -e .

Obtaining file:///Users/echarles/private/datalayer-platform/ext/jupyter-notebook-classic
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [49 lines of output]
Traceback (most recent call last):
File "/Users/echarles/private/datalayer-platform/ext/jupyter-notebook-classic/nbclassic/init.py", line 15, in
from notebook._version import version_info as notebook_version_info
ModuleNotFoundError: No module named 'notebook'

  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/Users/echarles/opt/miniconda3/envs/notebook/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
      main()
    File "/Users/echarles/opt/miniconda3/envs/notebook/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/echarles/opt/miniconda3/envs/notebook/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
      exec(code, locals())
    File "<string>", line 109, in <module>
    File "<string>", line 106, in main
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 159, in setup
      dist.parse_config_files()
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 864, in parse_config_files
      setupcfg.parse_configuration(
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 174, in parse_configuration
      meta.parse()
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 496, in parse
      section_parser_method(section_options)
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 470, in parse_section
      self[name] = value
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 278, in __setitem__
      value = parser(value)
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 602, in _parse_version
      return expand.version(self._parse_attr(value, self.package_dir, self.root_dir))
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 412, in _parse_attr
      return expand.read_attr(attr_desc, package_dir, root_dir)
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/config/expand.py", line 188, in read_attr
      spec = _find_spec(module_name, path)
    File "/private/var/folders/ly/vnyntf3n7q76382_rymt0qbm0000gn/T/pip-build-env-3sjtw1bh/overlay/lib/python3.9/site-packages/setuptools/config/expand.py", line 200, in _find_spec
      spec = spec or importlib.util.find_spec(module_name)
    File "/Users/echarles/opt/miniconda3/envs/notebook/lib/python3.9/importlib/util.py", line 94, in find_spec
      parent = __import__(parent_name, fromlist=['__path__'])
    File "/Users/echarles/private/datalayer-platform/ext/jupyter-notebook-classic/nbclassic/__init__.py", line 21, in <module>
      import jupyter_server
  ModuleNotFoundError: No module named 'jupyter_server'
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@blink1073
Copy link
Member

Notebook needs to be added to the build system requires deps:

requires = ["jupyter_packaging~=0.9,<2", "babel"]

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

@echarles echarles marked this pull request as ready for review November 23, 2022 07:17
@echarles echarles merged commit d4f3450 into jupyter:main Nov 23, 2022
@echarles
Copy link
Member Author

Thx @blink1073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setup.py and setup.cfg metadata is inconsistent
2 participants