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

Update install #31

Open
oruebel opened this issue Oct 27, 2023 · 6 comments
Open

Update install #31

oruebel opened this issue Oct 27, 2023 · 6 comments
Assignees

Comments

@oruebel
Copy link
Contributor

oruebel commented Oct 27, 2023

  • Use pyproject.toml instead of setup.py
  • Replace use of versioneer
  • Make release on PyPy (optional for now)
@oruebel
Copy link
Contributor Author

oruebel commented Mar 31, 2024

@mavaylon1 since you dealt with moving to pyproject.toml and replacing versioneer on the other repos, could you do this for this repo as well. This not a high pressure issue right now, but would be nice to do in the next few month.

@mavaylon1
Copy link

Can do

@rly
Copy link
Collaborator

rly commented Jul 13, 2024

Versioneer is no longer supported and we have stopped using it in other NWB/HDMF repos.

It seems like it is blocking the use of nwb-project-analytics with Python 3.12. I don't think we need to use it here because this package is not released on PyPI and does not need to be specially versioned. I also think we do not need to release this package on PyPI.

Collecting git+https://github.com/NeurodataWithoutBorders/nwb-project-analytics.git (from -r requirements.txt (line 7))
  Cloning https://github.com/NeurodataWithoutBorders/nwb-project-analytics.git to /tmp/pip-req-build-4_8ln0gg
  Running command git clone --filter=blob:none --quiet https://github.com/NeurodataWithoutBorders/nwb-project-analytics.git /tmp/pip-req-build-4_8ln0gg
  Resolved https://github.com/NeurodataWithoutBorders/nwb-project-analytics.git to commit bb6d29310d37c2eb86b27a9a5160ad93d76971b5
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      /tmp/pip-req-build-4_8ln0gg/versioneer.py:422: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      found these packages: ['nwb_project_analytics']
      ['numpy', 'pandas', 'ruamel.yaml', 'GitPython', 'PyGithub', 'setuptools', 'matplotlib', 'tqdm', 'requests', 'hdmf-docutils', 'cloc']
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/Python/3.[12](https://github.com/NeurodataWithoutBorders/nwb-overview/actions/runs/9920899609/job/27408270362?pr=165#step:5:13).4/x64/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wuy8opvx/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wuy8opvx/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-wuy8opvx/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-wuy8opvx/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 3[13](https://github.com/NeurodataWithoutBorders/nwb-overview/actions/runs/9920899609/job/27408270362?pr=165#step:5:14), in run_setup
          exec(code, locals())
        File "<string>", line 36, in <module>
        File "/tmp/pip-req-build-4_8ln0gg/versioneer.py", line 1540, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "/tmp/pip-req-build-4_8ln0gg/versioneer.py", line [14](https://github.com/NeurodataWithoutBorders/nwb-overview/actions/runs/9920899609/job/27408270362?pr=165#step:5:15)72, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-req-build-4_8ln0gg/versioneer.py", line 343, in get_config_from_root
          parser = configparser.SafeConfigParser()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
      [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.

@yarikoptic
Copy link
Collaborator

FWIW there is 3.12 support in versioneer, might be just not released?
https://github.com/python-versioneer/python-versioneer/blob/master/pyproject.toml

Just use master version?

@rly
Copy link
Collaborator

rly commented Jul 13, 2024

I see. The latest versioneer indeed supports 3.12, but personally I prefer to have one fewer script to maintain. If we want dynamic versioning, I suggest we use hatch-vcs which we use in pynwb/hdmf (it's slightly different but does enough of the job).

@oruebel
Copy link
Contributor Author

oruebel commented Jul 30, 2024

A related issue is that the repo currently lists requirements in two places:

reqs = [
'numpy',
'pandas',
'ruamel.yaml',
'GitPython',
'PyGithub',
'setuptools',
'matplotlib',
'tqdm',
'requests',
'hdmf-docutils',
'cloc',
'dandi'
]

and

numpy
pandas
ruamel.yaml
setuptools
GitPython
matplotlib
cloc # https://github.com/AlDanial/cloc
requests
hdmf-docutils # used to programmatically create RST pages
PyGithub # For issue response time analysis
tqdm # For issue response time analysis
dandi

In #19 I added dandi to the requirements.txt but not setup.py which in turn broke the build for the nwb-overview website. It would be nice to have requirements maintained in a single place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants