[builddeps] Activate pytest plugin for Celery #138

Closed
hansegucker wants to merge 1 commit from active-pytest-celery into master
hansegucker commented 2021-04-11 18:58:55 +02:00 (Migrated from edugit.org)

I had to set an explicit version for the Python dependency because otherwise the black and isort dependencies caused resolver errors.

I had to set an explicit version for the Python dependency because otherwise the black and isort dependencies caused resolver errors.
nik commented 2021-04-11 19:08:06 +02:00 (Migrated from edugit.org)

Please fix the resolver error instead of adding an unnecessarily explicit dependency.

Please fix the resolver error instead of adding an unnecessarily explicit dependency.
hansegucker commented 2021-04-11 19:10:21 +02:00 (Migrated from edugit.org)

If someone could explain this error to me, that would be an option, of course:

poetry update
Updating dependencies
Resolving dependencies... (2.8s)

  SolverProblemError

  The current project's Python requirement (>=2.7,<2.8 || >=3.4) is not compatible with some of the required packages Python requirement:
    - black requires Python >=3.6, so it will not be satisfied for Python >=2.7,<2.8 || >=3.4,<3.6
  
  Because black (19.10b0) requires Python >=3.6
   and no versions of black match >19.10b0,<20.0, black is forbidden.
  So, because aleksis-builddeps depends on black (^19.10b0), version solving failed.

  at /usr/local/lib/python3.9/dist-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For black, a possible solution would be to set the `python` property to ">=3.6"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers
If someone could explain this error to me, that would be an option, of course: ``` poetry update Updating dependencies Resolving dependencies... (2.8s) SolverProblemError The current project's Python requirement (>=2.7,<2.8 || >=3.4) is not compatible with some of the required packages Python requirement: - black requires Python >=3.6, so it will not be satisfied for Python >=2.7,<2.8 || >=3.4,<3.6 Because black (19.10b0) requires Python >=3.6 and no versions of black match >19.10b0,<20.0, black is forbidden. So, because aleksis-builddeps depends on black (^19.10b0), version solving failed. at /usr/local/lib/python3.9/dist-packages/poetry/puzzle/solver.py:241 in _solve 237│ packages = result.packages 238│ except OverrideNeeded as e: 239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest) 240│ except SolveFailure as e: → 241│ raise SolverProblemError(e) 242│ 243│ results = dict( 244│ depth_first_search( 245│ PackageNode(self._package, packages), aggregate_package_nodes • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties For black, a possible solution would be to set the `python` property to ">=3.6" https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies, https://python-poetry.org/docs/dependency-specification/#using-environment-markers ```
nik commented 2021-04-11 19:13:04 +02:00 (Migrated from edugit.org)

This dependency is unnecessary.

This dependency is unnecessary.
nik commented 2021-04-11 19:13:05 +02:00 (Migrated from edugit.org)

I don't think we should depend on this, given that this library has not yet been released and seems unmaintained in general.

I don't think we should depend on this, given that this library has not yet been released and seems unmaintained in general.
hansegucker commented 2021-04-11 19:16:24 +02:00 (Migrated from edugit.org)

According to the documentation at https://docs.celeryproject.org/en/stable/userguide/testing.html, we also could add celery[pytest], but that also results in the installation of the meta package pytest-celery.

According to the documentation at https://docs.celeryproject.org/en/stable/userguide/testing.html, we also could add ``celery[pytest]``, but that also results in the installation of the meta package ``pytest-celery``.
nik commented 2021-04-11 19:19:39 +02:00 (Migrated from edugit.org)

- black requires Python >=3.6, so it will not be satisfied for Python >=2.7,<2.8 || >=3.4,<3.6

The interesting part is where this additiona <3.6 comes from.

However, as this dependency is entirely useless, I recommend going without it instead of debugging this issue.

> `- black requires Python >=3.6, so it will not be satisfied for Python >=2.7,<2.8 || >=3.4,<3.6` The interesting part is where this additiona `<3.6` comes from. However, as this dependency is entirely useless, I recommend going without it instead of debugging this issue.
nik commented 2021-04-11 19:20:53 +02:00 (Migrated from edugit.org)

According to the documentaiton, we could also just set PYTEST_PLUGINS=celery.contrib.pytest in the environment, instead of bloating our dependencies to do just that.

According to the documentaiton, we could also just set `PYTEST_PLUGINS=celery.contrib.pytest` in the environment, instead of bloating our dependencies to do just that.
nik (Migrated from edugit.org) closed this pull request 2021-04-11 19:21:20 +02:00
hansegucker commented 2021-04-11 19:21:58 +02:00 (Migrated from edugit.org)

In which environment?

In which environment?
nik commented 2021-04-11 19:22:43 +02:00 (Migrated from edugit.org)
**The** environment, as in https://pubs.opengroup.org/onlinepubs/009696899/basedefs/xbd_chap08.html
hansegucker commented 2021-04-11 19:27:39 +02:00 (Migrated from edugit.org)

Yes, of course, but you don't want to rely on each user to set their environment variables correctly, do you?

Yes, of course, but you don't want to rely on each user to set their environment variables correctly, do you?
hansegucker commented 2021-04-11 19:28:09 +02:00 (Migrated from edugit.org)

Do you want to add this variable in the tox.ini file?

Do you want to add this variable in the `tox.ini` file?
nik commented 2021-04-11 19:28:55 +02:00 (Migrated from edugit.org)

I knew you'd figure it out ☺!

I knew you'd figure it out ☺!
nik commented 2021-04-11 19:30:25 +02:00 (Migrated from edugit.org)

(Or use the conftest.py mechanism. I will leave that up to you…

(Or use the `conftest.py` mechanism. I will leave that up to you…

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aleksis/AlekSIS!138
No description provided.