Skip to content

Commit 29c5cbc

Browse files
committed
- Drop support for Python 3.6 (vcrpy needs >=4.3.0 for Py 3.11, so we can't support both)
- Run `pyupgrade` again, this time with 3.7+ - Make sure setup.py install_requires matches requirements.txt
1 parent 5e16160 commit 29c5cbc

File tree

12 files changed

+27
-27
lines changed

12 files changed

+27
-27
lines changed

.github/workflows/testing_initiative.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
os: [ubuntu-20.04, macos-13, windows-latest]
37-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
37+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
3838
no-coverage: [0]
3939
include:
4040
- os: ubuntu-20.04

dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
-r requirements.txt
33

4-
vcrpy==4.3.0
4+
vcrpy==4.4.0 # TODO: 5.0.0 drops support for Python 3.7
55
PyYAML>=5.4
66
mock==1.3.0
77
coverage>=5.0

generate_enums_from_proto.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@
8383

8484
for class_name, (attrs, attrs_starting_with_number) in sorted(classes.items(), key=lambda x: x[0].lower()):
8585
if attrs_starting_with_number:
86-
print("\n{} = SteamIntEnum({!r}, {{".format(class_name, class_name))
86+
print(f"\n{class_name} = SteamIntEnum({class_name!r}, {{")
8787
for ikey, ivalue in attrs.items():
88-
print(" {!r}: {!r},".format(ikey, ivalue))
88+
print(f" {ikey!r}: {ivalue!r},")
8989
print(" })")
9090
else:
9191
print(f"\nclass {class_name}(SteamIntEnum):")

requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
pycryptodomex>=3.7.0
22
requests>=2.9.1
3-
urllib3<2
4-
vdf @ git+https://github.com/solsticegamestudios/vdf
3+
urllib3<2 # See https://github.com/kevin1024/vcrpy/pull/699#issuecomment-1551439663
4+
vdf @ git+https://github.com/solsticegamestudios/[email protected]
5+
cachetools>=3.0.0
6+
57
gevent>=1.3.0
68
protobuf~=3.0
79
gevent-eventemitter~=2.1
8-
cachetools>=3.0.0

setup.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
install_requires = [
1717
'pycryptodomex>=3.7.0',
1818
'requests>=2.9.1',
19-
'urllib3<2',
20-
'vdf>=3.3',
19+
'urllib3<2', # See https://github.com/kevin1024/vcrpy/pull/699#issuecomment-1551439663
20+
'vdf @ git+https://github.com/solsticegamestudios/[email protected]',
2121
'cachetools>=3.0.0',
2222
]
2323

@@ -38,20 +38,19 @@
3838
author="Rossen Georgiev / Solstice Game Studios",
3939
author_email='[email protected]',
4040
license='MIT',
41-
python_requires=">=3.6",
41+
python_requires=">=3.7",
4242
classifiers=[
4343
'Development Status :: 5 - Production/Stable',
4444
'Natural Language :: English',
4545
'Intended Audience :: Developers',
4646
'License :: OSI Approved :: MIT License',
4747
'Operating System :: OS Independent',
48-
'Programming Language :: Python :: 3.6',
4948
'Programming Language :: Python :: 3.7',
5049
'Programming Language :: Python :: 3.8',
5150
'Programming Language :: Python :: 3.9',
5251
'Programming Language :: Python :: 3.10',
5352
'Programming Language :: Python :: 3.11',
54-
'Programming Language :: Python :: 3.12',
53+
#'Programming Language :: Python :: 3.12', # TODO: Needs vcrpy>=6.0.0
5554
'Programming Language :: Python :: Implementation :: PyPy',
5655
],
5756
keywords='valve steam steamid api webapi steamcommunity',

steam/client/cdn.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def get_content_servers_from_cs(cell_id, host='cs.steamcontent.com', port=80, nu
146146
"""
147147
proto = 'https' if port == 443 else 'http'
148148

149-
url = '{}://{}:{}/serverlist/{}/{}/'.format(proto, host, port, cell_id, num_servers)
149+
url = f'{proto}://{host}:{port}/serverlist/{cell_id}/{num_servers}/'
150150
session = make_requests_session() if session is None else session
151151
resp = session.get(url)
152152

@@ -598,7 +598,7 @@ def get_chunk(self, app_id, depot_id, chunk_id):
598598
:raises SteamError: error message
599599
"""
600600
if (depot_id, chunk_id) not in self._chunk_cache:
601-
resp = self.cdn_cmd('depot', '{}/chunk/{}'.format(depot_id, chunk_id))
601+
resp = self.cdn_cmd('depot', f'{depot_id}/chunk/{chunk_id}')
602602

603603
data = symmetric_decrypt(resp.content, self.get_depot_key(app_id, depot_id))
604604

@@ -661,7 +661,7 @@ def get_manifest_request_code(self, app_id, depot_id, manifest_gid, branch='publ
661661
)
662662

663663
if resp is None or resp.header.eresult != EResult.OK:
664-
raise SteamError("Failed to get manifest code for {}, {}, {}".format(app_id, depot_id, manifest_gid),
664+
raise SteamError(f"Failed to get manifest code for {app_id}, {depot_id}, {manifest_gid}",
665665
EResult.Timeout if resp is None else EResult(resp.header.eresult))
666666

667667
return resp.body.manifest_request_code
@@ -684,9 +684,9 @@ def get_manifest(self, app_id, depot_id, manifest_gid, decrypt=True, manifest_re
684684
"""
685685
if (app_id, depot_id, manifest_gid) not in self.manifests:
686686
if manifest_request_code:
687-
resp = self.cdn_cmd('depot', '{}/manifest/{}/5/{}'.format(depot_id, manifest_gid, manifest_request_code))
687+
resp = self.cdn_cmd('depot', f'{depot_id}/manifest/{manifest_gid}/5/{manifest_request_code}')
688688
else:
689-
resp = self.cdn_cmd('depot', '{}/manifest/{}/5'.format(depot_id, manifest_gid))
689+
resp = self.cdn_cmd('depot', f'{depot_id}/manifest/{manifest_gid}/5')
690690

691691
if resp.ok:
692692
manifest = self.DepotManifestClass(self, app_id, resp.content)
@@ -757,7 +757,7 @@ def get_manifests(self, app_id, branch='public', password=None, filter_func=None
757757
is_enc_branch = False
758758

759759
if branch not in depots.get('branches', {}):
760-
raise SteamError("No branch named {} for app_id {}".format(repr(branch), app_id))
760+
raise SteamError(f"No branch named {repr(branch)} for app_id {app_id}")
761761
elif int(depots['branches'][branch].get('pwdrequired', 0)) > 0:
762762
is_enc_branch = True
763763

steam/core/cm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def send(self, message):
204204
message.sessionID = self.session_id
205205

206206
if self.verbose_debug:
207-
self._LOG.debug("Outgoing: {}\n{}".format(repr(message), str(message)))
207+
self._LOG.debug(f"Outgoing: {repr(message)}\n{str(message)}")
208208
else:
209209
self._LOG.debug("Outgoing: %s", repr(message))
210210

@@ -277,7 +277,7 @@ def _parse_message(self, message):
277277
msg.parse()
278278

279279
if self.verbose_debug:
280-
self._LOG.debug("Incoming: {}\n{}".format(repr(msg), str(msg)))
280+
self._LOG.debug(f"Incoming: {repr(msg)}\n{str(msg)}")
281281
else:
282282
self._LOG.debug("Incoming: %s", repr(msg))
283283

steam/core/msg/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def __repr__(self):
150150
else:
151151
suffix = 'n/a'
152152

153-
return "<Msg({!r} | {})>".format(self.msg, suffix)
153+
return f"<Msg({self.msg!r} | {suffix})>"
154154

155155
def __str__(self):
156156
rows = [repr(self)]
@@ -238,7 +238,7 @@ def __repr__(self):
238238
else:
239239
suffix = 'n/a'
240240

241-
return "<MsgProto({!r} | {})>".format(self.msg, suffix)
241+
return f"<MsgProto({self.msg!r} | {suffix})>"
242242

243243
def __str__(self):
244244
rows = [repr(self)]

steam/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def __init__(self, message, eresult=EResult.Fail):
88
self.eresult = EResult(eresult) #: :class:`.EResult`
99

1010
def __str__(self):
11-
return "({}) {}".format(self.eresult, self.message)
11+
return f"({self.eresult}) {self.message}"
1212

1313
class ManifestError(SteamError):
1414
"""

steam/game_servers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def query_master(filter_text=r'\nappid\500', max_servers=20, region=MSRegion.Wor
229229
ms.close()
230230
return
231231

232-
next_ip = f'{ip}:{port}'.encode('utf-8')
232+
next_ip = f'{ip}:{port}'.encode()
233233

234234
ms.close()
235235

0 commit comments

Comments
 (0)