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

build: update deps, remove isort and black. #31

Merged
merged 10 commits into from
Apr 2, 2024

Conversation

radoshi
Copy link
Contributor

@radoshi radoshi commented Mar 24, 2024

Configuration update PR.

  1. Removes python3.12 support. This currently fails and needs more work to enable it.
  2. Removes isort and black. Modern versions of ruff cover this functionality.
  3. New poetry.lock to update the version of ruff.

…passed to the runner (olzhasar#29)

* fix: prevent argparse from eating up abbreviated args that should be passed to the runner

* build: fixing with `ruff check .`

* build: formatting update.
@olzhasar
Copy link
Owner

Why do you want to remove python3.12 support?

@radoshi
Copy link
Contributor Author

radoshi commented Mar 25, 2024 via email

@olzhasar
Copy link
Owner

olzhasar commented Apr 1, 2024

Yes, it works without issues on my end. Are you sure you have Python 3.12 installed on your machine?

@radoshi
Copy link
Contributor Author

radoshi commented Apr 1, 2024 via email

@olzhasar
Copy link
Owner

olzhasar commented Apr 2, 2024

@radoshi Could you share what error do you get when trying to install requirements with Python 3.12?

@radoshi
Copy link
Contributor Author

radoshi commented Apr 2, 2024

Last login: Mon Apr  1 12:39:38 on ttys000
➜  ~ git clone https://github.com/olzhasar/pytest-watcher.git
Cloning into 'pytest-watcher'...
remote: Enumerating objects: 842, done.
remote: Counting objects: 100% (411/411), done.
remote: Compressing objects: 100% (217/217), done.
remote: Total 842 (delta 278), reused 295 (delta 188), pack-reused 431
Receiving objects: 100% (842/842), 662.68 KiB | 2.32 MiB/s, done.
Resolving deltas: 100% (521/521), done.
➜  ~ cd pytest-watcher
➜  pytest-watcher git:(master) poetry --version
Poetry (version 1.7.1)
➜  pytest-watcher git:(master) poetry env use python3.12
Using virtualenv: /Users/rushabh/Library/Caches/pypoetry/virtualenvs/pytest-watcher-u_Ef5ItY-py3.12
➜  pytest-watcher git:(master) poetry install
Installing dependencies from lock file

Package operations: 12 installs, 0 updates, 0 removals

  • Installing pyyaml (6.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke get_requires_for_build_wheel

  running egg_info
  writing lib/PyYAML.egg-info/PKG-INFO
  writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
  writing top-level names to lib/PyYAML.egg-info/top_level.txt
  Traceback (most recent call last):
    File "/Users/rushabh/Library/Application Support/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/rushabh/Library/Application Support/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/rushabh/Library/Application Support/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 288, in <module>
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/__init__.py", line 104, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 967, in run_command
      super().run_command(command)
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 321, in run
      self.find_sources()
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
      mm.run()
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 550, in run
      self.add_defaults()
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 588, in add_defaults
      sdist.add_defaults(self)
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/command/sdist.py", line 102, in add_defaults
      super().add_defaults()
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
      self._add_defaults_ext()
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<string>", line 204, in get_source_files
    File "/private/var/folders/ft/t1sw808d0dl8r9fk9dd22chh0000gn/T/tmpw4morbqm/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
      raise AttributeError(attr)
  AttributeError: cython_sources


  at ~/Library/Application Support/pipx/venvs/poetry/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
      160│
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│
      163│             if error is not None:
    → 164│                 raise error from None
      165│
      166│             return path
      167│
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with pyyaml (6.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pyyaml (==6.0)"'.

➜  pytest-watcher git:(master)

@olzhasar
Copy link
Owner

olzhasar commented Apr 2, 2024

@radoshi Thank you. I was able to reproduce it on my Mac, looks like some weird dev dependency conflict. It should now be working without issues.

I have made some additional changes here to ensure that pre-commit hook versions match the ones from poetry.lock.

Also, it turns out that ruff does not sort imports by default, I had to make a minor configuring for that to work

@olzhasar olzhasar merged commit aebcf85 into olzhasar:master Apr 2, 2024
7 checks passed
@radoshi
Copy link
Contributor Author

radoshi commented Apr 2, 2024 via email

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

Successfully merging this pull request may close these issues.

2 participants