Title: Loosen black requirements, and add stricter ones as a dev dependency · Issue #411 · openapi-generators/openapi-python-client · GitHub
Open Graph Title: Loosen black requirements, and add stricter ones as a dev dependency · Issue #411 · openapi-generators/openapi-python-client
X Title: Loosen black requirements, and add stricter ones as a dev dependency · Issue #411 · openapi-generators/openapi-python-client
Description: Describe the bug A clear and concise description of what the bug is. Hey there! I've run into a situation where I can't resolve my application's black dependency, because this library specifies a particular version in its package manifes...
Open Graph Description: Describe the bug A clear and concise description of what the bug is. Hey there! I've run into a situation where I can't resolve my application's black dependency, because this library specifies a p...
X Description: Describe the bug A clear and concise description of what the bug is. Hey there! I've run into a situation where I can't resolve my application's black dependency, because this library s...
Opengraph URL: https://github.com/openapi-generators/openapi-python-client/issues/411
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Loosen black requirements, and add stricter ones as a dev dependency","articleBody":"**Describe the bug**\r\n\u003e A clear and concise description of what the bug is.\r\n\r\nHey there! I've run into a situation where I can't resolve my application's `black` dependency, because this library specifies a particular version in its package manifest.\r\n\r\nBased on [this PR](https://github.com/triaxtec/openapi-python-client/pull/394), it seems like `openapi-python-client` uses `black` as a development dependency for formatting its own code. It also requires it as a runtime dependency in consuming projects [so it can format its generated code](https://github.com/triaxtec/openapi-python-client/blob/113648731d047dd10badc4df9b44c60a61be5cae/openapi_python_client/__init__.py#L131).\r\n\r\nCurrently, this library declares a dependency on `black` in [the required package manifest](https://github.com/triaxtec/openapi-python-client/blob/22c344fdae9cdf8a2219bd458d3037c15f1c5e93/pyproject.toml#L21). This forces `openapi-python-client` users to depend on a compatible `black` version, which is currently a narrow range.\r\n\r\nI believe we should ***require*** library consumers to use a far less specific version of `black` (like perhaps just `20+` in general), and then add our preferred version range (currently: `black\u003c22.0,\u003e=21.4b0`) into the [development dependencies](https://github.com/triaxtec/openapi-python-client/blob/22c344fdae9cdf8a2219bd458d3037c15f1c5e93/pyproject.toml#L40) instead.\r\n\r\n**To Reproduce**\r\n\u003e Steps to reproduce the behavior\r\n\r\n1. Install python `3.9.4`\r\n2. `pip install pipenv`\r\n3. Create a `Pipfile` with the content below\r\n4. Run `pipenv install --dev --pre` and see the failure output below\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003ePipfile\u003c/summary\u003e\r\n\r\n```toml\r\n[[source]]\r\n name = \"pypi\"\r\n url = \"https://pypi.org/simple\"\r\n verify_ssl = true\r\n\r\n[requires]\r\n python_version = \"3.9\"\r\n\r\n[dev-packages]\r\n # DEVTOOLS\r\n black = \"~=20.8b0\" # Formatter\r\n openapi-python-client = \"~=0.8\" # API client lib generator\r\n\r\npipenv = \"*\"\r\n[pipenv]\r\n allow_prereleases = true\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eoutput\u003c/summary\u003e\r\n\r\n```\r\nCreating a virtualenv for this project...\r\nPipfile: /Users/keele/Projects/oss/bug-reports/Pipfile\r\nUsing /Users/keele/.config/asdf/data/installs/python/3.9.4/bin/python3.9 (3.9.4) to create virtualenv...\r\n⠇ Creating virtual environment...created virtual environment CPython3.9.4.final.0-64 in 500ms\r\n creator CPython3Posix(dest=/Users/keele/.local/share/virtualenvs/bug-reports-kpKsivT_, clear=False, no_vcs_ignore=False, global=False)\r\n seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/keele/Library/Application Support/virtualenv)\r\n added seed packages: pip==21.0.1, setuptools==54.2.0, wheel==0.36.2\r\n activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator\r\n\r\n✔ Successfully created virtual environment!\r\nVirtualenv location: /Users/keele/.local/share/virtualenvs/bug-reports-kpKsivT_\r\nPipfile.lock not found, creating...\r\nLocking [dev-packages] dependencies...\r\nBuilding requirements...\r\nResolving dependencies...\r\n✘ Locking Failed!\r\n[ResolutionFailure]: File \"/Users/keele/.config/asdf/data/installs/python/3.9.4/lib/python3.9/site-packages/pipenv/resolver.py\", line 741, in _main\r\n[ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)\r\n[ResolutionFailure]: File \"/Users/keele/.config/asdf/data/installs/python/3.9.4/lib/python3.9/site-packages/pipenv/resolver.py\", line 702, in resolve_packages\r\n[ResolutionFailure]: results, resolver = resolve(\r\n[ResolutionFailure]: File \"/Users/keele/.config/asdf/data/installs/python/3.9.4/lib/python3.9/site-packages/pipenv/resolver.py\", line 684, in resolve\r\n[ResolutionFailure]: return resolve_deps(\r\n[ResolutionFailure]: File \"/Users/keele/.config/asdf/data/installs/python/3.9.4/lib/python3.9/site-packages/pipenv/utils.py\", line 1395, in resolve_deps\r\n[ResolutionFailure]: results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(\r\n[ResolutionFailure]: File \"/Users/keele/.config/asdf/data/installs/python/3.9.4/lib/python3.9/site-packages/pipenv/utils.py\", line 1108, in actually_resolve_deps\r\n[ResolutionFailure]: resolver.resolve()\r\n[ResolutionFailure]: File \"/Users/keele/.config/asdf/data/installs/python/3.9.4/lib/python3.9/site-packages/pipenv/utils.py\", line 833, in resolve\r\n[ResolutionFailure]: raise ResolutionFailure(message=str(e))\r\n[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.\r\n First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.\r\n Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.\r\n Hint: try $ pipenv lock --pre if it is a pre-release dependency.\r\nERROR: Could not find a version that matches black\u003c22.0,\u003e=21.4b0,~=20.8b0 (from -r /var/folders/8c/5ssnllx97txcvkptv3hbx5gr0000gn/T/pipenvjbrakla8requirements/pipenv-l3swafsz-constraints.txt (line 3))\r\nSkipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2, 21.5b0, 21.5b0\r\nThere are incompatible versions in the resolved dependencies:\r\n black~=20.8b0 (from -r /var/folders/8c/5ssnllx97txcvkptv3hbx5gr0000gn/T/pipenvjbrakla8requirements/pipenv-l3swafsz-constraints.txt (line 3))\r\n black\u003c22.0,\u003e=21.4b0 (from openapi-python-client==0.9.0-\u003e-r /var/folders/8c/5ssnllx97txcvkptv3hbx5gr0000gn/T/pipenvjbrakla8requirements/pipenv-l3swafsz-constraints.txt (line 4))\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n**Expected behavior**\r\n\u003e A clear and concise description of what you expected to happen.\r\n\r\nI expect to be able to use the version of `black` my project requires without having to use whatever version `openapi-python-client` happens to prefer as a dev dependency.\r\n\r\n**Desktop (please complete the following information):**\r\n - OS: macOS 11.2.3 Big Sur\r\n - Python Version: 3.9.4\r\n - openapi-python-client version 0.9.0\r\n\r\n**Additional context**\r\n\u003e Add any other context about the problem here.\r\n\r\nMy specific usecase here: my application uses `black` v`20.8b0` as a development dependency to strictly match the version that the `pre-commit` tools uses in CI; and it uses `openapi-python-client` v`0.9.0` is a development dependency to generate libraries in CI as well. This version requires `black\u003c22.0,\u003e=21.4b0` as a hard dependency.","author":{"url":"https://github.com/christhekeele","@type":"Person","name":"christhekeele"},"datePublished":"2021-05-05T21:19:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/411/openapi-python-client/issues/411"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:451bc8d8-0bcd-6a4b-1d00-027b5c57aaa6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E730:98BCF:A9421D:E67B5F:69806BD8 |
| html-safe-nonce | af952dd66d2b817cbd1f4eeebba9423d874f44bbbf6feca7c47745697d2ddcb0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzMwOjk4QkNGOkE5NDIxRDpFNjdCNUY6Njk4MDZCRDgiLCJ2aXNpdG9yX2lkIjoiNDI4MjcyMDY3MDk3MTg4MjQ1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 17ae95482523b5a5d94fef2a133170df9d730fb10688e5b07795ec69ff9a1eb0 |
| hovercard-subject-tag | issue:876845412 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/openapi-generators/openapi-python-client/411/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9c6730951a926ffbf9836e53ae7a23704a7f756a2f1f357a93192edfc58d0671/openapi-generators/openapi-python-client/issues/411 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9c6730951a926ffbf9836e53ae7a23704a7f756a2f1f357a93192edfc58d0671/openapi-generators/openapi-python-client/issues/411 |
| og:image:alt | Describe the bug A clear and concise description of what the bug is. Hey there! I've run into a situation where I can't resolve my application's black dependency, because this library specifies a p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | christhekeele |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0959b1a93ca48b0c88b3bddbdfd04ca43f388cb1a8293105a28c5ef6e8079db8 |
| turbo-cache-control | no-preview |
| go-import | github.com/openapi-generators/openapi-python-client git https://github.com/openapi-generators/openapi-python-client.git |
| octolytics-dimension-user_id | 84925606 |
| octolytics-dimension-user_login | openapi-generators |
| octolytics-dimension-repository_id | 240776275 |
| octolytics-dimension-repository_nwo | openapi-generators/openapi-python-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 240776275 |
| octolytics-dimension-repository_network_root_nwo | openapi-generators/openapi-python-client |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 78307334c66591a8f87f493dd2968126b34961dd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width