Skip to content

Installation of only one component of the package #101

Open

Description

@Askaholic

I use only the database functionality of this package, and do all web management myself using aiohttp. It would be great if this package didn't pull requests into my dependency graph as my application is entirely async, (and also didn't force my aiohttp version to be less than 4 in case that ever gets updated).

I think you can use the extras_require argument to setup() (with setuptools) to add optional dependencies. Maybe something like:

extras_require={
    "all": ["requests>=2.24.0,<3.0.0", "aiohttp>=3.6.2,<4.0.0"],
    "requests": "requests>=2.24.0,<3.0.0",
    "aiohttp": "aiohttp>=3.6.2,<4.0.0",
}

For reference: https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#id7
And example: https://github.com/palantir/python-language-server/blob/0fa74bae6fbb331498dbc39b6257d74357edea2f/setup.py#L51

Additionally, I see that urllib3 is listed in the requirements, but I don't see it being imported anywhere. Maybe that can be removed?

Activity

  1. sg3-141-592 commented on Nov 8, 2020

    @sg3-141-592

    I noticed a similar issue when putting together an offline install of this package. I've also noticed the version of requests is very specific (June 2020 version and onwards), and can be loosened.

    I've raised Pull Request #104 to

    • Remove urllib3
    • Make aiohttp and requests optional dependencies
    • Loosen the version of the requests library that can be used

    I can understand if the maintainers don't want to make aiohttp and requests optional as it'll require anyone pulling this library in to do a different install command, and they might have issues with existing projects if they use this library as an unpinned dependency. I thought it was worth raising the Pull Request anyway, see what the feedback is like. I think the urllib and requests version change are worth including, even if adding the optional dependencies is too disruptive.

  2. menecio commented on Mar 8, 2021

    @menecio

    In our case is exactly the opposite, but still the same principle. We have geoip2 as a dependency in our django projects but we aren't using asyncio at all, so having aiohttp as an optional requirement would be ideal.

  3. adi1 commented on Mar 16, 2022

    @adi1

    Maxmind is retiring legacy databases on May 31 2022, forcing users to upgrade to GeoIP2 format. This means that all projects which are using only the offline database are now forced to install the unnecessary aiohttp client and its dependencies.

    Is there any plan to make this dependency optional?

  4. oschwald commented on Mar 16, 2022

    @oschwald
    Member

    There is no immediate plans on doing this. As mentioned above, it may make sense to break this package into several packages at some point, but it is unlikely to happen soon.

    If you are particularly concerned about unnecessary dependencies, I would suggest using maxminddb directly.

  5. adi1 commented on Mar 16, 2022

    @adi1

    There is no immediate plans on doing this. As mentioned above, it may make sense to break this package into several packages at some point, but it is unlikely to happen soon.

    If you are particularly concerned about unnecessary dependencies, I would suggest using maxminddb directly.

    thanks for the db reader tip, this is exactly what I was looking for!

  6. added 2 commits that reference this issue on Aug 27, 2024
    50c3b8e
    ff4972e
  7. added 2 commits that reference this issue on Feb 10, 2025
    6ac3f9c
    0eebbbd
  8. added 3 commits that reference this issue on Aug 20, 2025
    46cce6f
    e014f68
    8e25cdf
  9. added a commit that references this issue on Sep 4, 2025
    002a692
  10. added a commit that references this issue on Sep 29, 2025
    7cd0e2b
  11. added 4 commits that reference this issue on Jul 22, 2026
    1deb3b4
    6184e6d
    767efa2
    d3688bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions