Skip to content

Allow installing aiodns and cchardet as extras #3412

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

Merged
merged 1 commit into from
Nov 29, 2018
Merged

Allow installing aiodns and cchardet as extras #3412

merged 1 commit into from
Nov 29, 2018

Conversation

WouldYouKindly
Copy link
Contributor

@WouldYouKindly WouldYouKindly commented Nov 29, 2018

Users will be able to install aiodns and cchardet using pip install aiohttp[aiodns,cchardet]

Related to #2397

@codecov-io
Copy link

codecov-io commented Nov 29, 2018

Codecov Report

Merging #3412 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3412   +/-   ##
=======================================
  Coverage   97.94%   97.94%           
=======================================
  Files          44       44           
  Lines        8511     8511           
  Branches     1382     1382           
=======================================
  Hits         8336     8336           
  Misses         74       74           
  Partials      101      101

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ebc453...8f42477. Read the comment docs.

@asvetlov asvetlov merged commit f09cec5 into aio-libs:master Nov 29, 2018
@asvetlov
Copy link
Member

Thanks!

@@ -109,6 +109,11 @@ def read(f):
'pytest-xdist',
]

extras_require = {
'cchardet': ['cchardet'],
'aiodns': ['aiodns'],
Copy link
Member

Choose a reason for hiding this comment

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

I'd go for smth like dns-speedup and charset-speedup to make extras represent feature flags, not end-dependencies. This also allows to abstract extra names and make those deps easily replaceable.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, looks like I've pressed 'merge' too fast.

The chance of libraries replacement is very low.
I doubt if we'll do it at all.
But I like speedup requirement name.
What if we add 'speedup: ['aiodns', 'cchardet']` line to requirements for quick installation of all available accellerators?

P.S.
I've missed 'brotli', it is another optional dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@asvetlov are there viable cases when one would want to install aiodns but not cchardet or vice versa? If no, speedup(s?) sounds cool.

Copy link
Member

Choose a reason for hiding this comment

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

For example, user wants to use aiodns but cchardet installation faild on his system.
Or aiodns doesn't work well for some reason, e.g. it doesn't respect all OS configuration files.

Copy link
Member

Choose a reason for hiding this comment

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

Well, there's speedups in plural I saw used in other distributions. We could use that for "everything".

As for "it's not likely to change", while it's likely true I'd like to point out that there will probably be other dependencies and I'd like to see extra names being consistent as it's a public API, so changing names would be difficult.

I don't want to end up with a bunch of extras named using different random strategies. And I think extras should name features, not implementations.

Bottom line: we might want to have separate extra deps + one "wholesale" extra.

Copy link
Member

Choose a reason for hiding this comment

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

I like it.
The only thing we need to think about is naming.
cchardet is definitely a speedup.
aiodns is not. I can boost the execution time but the main point is using nonblocking async DNS API.
brotli is a feature, basically a support for another comression method (implemented partially now).

What are the best names for these features? Suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

Taking into account the conversation I've reverted the PR.
Let's make an agreement about exposed names first and only after it implement them.
The issue priority is low but I love to add changes only once without future renaming.

Copy link
Member

Choose a reason for hiding this comment

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

charset-guessing-speedup, async-dns and brotli-compression?

asvetlov added a commit that referenced this pull request Dec 1, 2018
@lock
Copy link

lock bot commented Dec 1, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Dec 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants