Skip to content

Resolve DeprecationWarning: distutils #14

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
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
dist/
forcediphttpsadapter.egg-info/*
4 changes: 2 additions & 2 deletions forcediphttpsadapter/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
# if it's <2.7.9 decide to use the old "http://$IP/ technique. If Python is
# >2.7.9 and the adapter doesn't work, unfortunately, there's nothing that can
# be done :(
from distutils.version import StrictVersion
from packaging.version import Version
from socket import error as SocketError, timeout as SocketTimeout

import requests
Expand All @@ -89,7 +89,7 @@
# Requests older than 2.4.0's VerifiedHHTPSConnection is broken and doesn't
# properly use _new_conn. On these versions, use UnverifiedHTTPSConnection
# instead.
if StrictVersion(requests.__version__) < StrictVersion('2.4.0'):
if Version(requests.__version__) < Version('2.4.0'):
from requests.packages.urllib3.connection import (
UnverifiedHTTPSConnection as HTTPSConnection
)
Expand Down
20 changes: 8 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from setuptools import setup, find_packages


PACKAGE_NAME = 'forcediphttpsadapter'
PACKAGE_VERSION = '1.0.2'
AUTHOR = 'Roadmaster'
EMAIL = 'daniel@tomechangosubanana.com'
URL = 'https://github.com/Roadmaster/forcediphttpsadapter'
PACKAGE_NAME = "forcediphttpsadapter"
PACKAGE_VERSION = "1.0.2"
AUTHOR = "Roadmaster"
EMAIL = "daniel@tomechangosubanana.com"
URL = "https://github.com/Roadmaster/forcediphttpsadapter"


setup(
Expand All @@ -24,19 +24,15 @@
url=URL,
# classifiers=CLASSIFIERS,
# platforms=PLATFORMS,
provides=['adapters'],
install_requires=['requests'],
provides=["adapters"],
install_requires=["packaging", "requests"],
# dependency_links=dependency_links,

packages=find_packages(),
# include_package_data=True,
# package_data=package_data,

download_url='{}/archive/master.zip'.format(URL),
download_url="{}/archive/master.zip".format(URL),
# keywords=KEYWORDS,
# scripts=scripts,

# entry_points={},

zip_safe=False,
)