Skip to content
Myr

setup.py

This file

Path

setup.py

67 lines · 1.7 KiB · Python

Last changed by

Use pathlib.Path instead of os.path functions (#188)Stephen Brown IIbefore adoptionfde30b8

History of this file

Take it

The walk stopped after 200 commits: lines older than 7bd9f32 point at it.

Version 0.0.2Tom Christiebefore adoption7bd9f32

lines 1–4why, one step back
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-34import re

Use pathlib.Path instead of os.path functions (#188)Stephen Brown IIbefore adoptionfde30b8

line 5why, one step back
5from pathlib import Path

Version 0.0.2Tom Christiebefore adoption7bd9f32

lines 6–13why, one step back
6
7from setuptools import setup8910def get_version(package):11 """12 Return package version as listed in `__version__` in `init.py`.13 """

Use pathlib.Path instead of os.path functions (#188)Stephen Brown IIbefore adoptionfde30b8

lines 14–15why, one step back
14 version = Path(package, "__version__.py").read_text()
15 return re.search("__version__ = ['\"]([^'\"]+)['\"]", version).group(1)

Version 0.0.2Tom Christiebefore adoption7bd9f32

lines 16–29why, one step back
16
1718def get_long_description():19 """20 Return the README.21 """22 with open("README.md", encoding="utf8") as f:23 return f.read()242526def get_packages(package):27 """28 Return root package and all sub-packages.29 """

Use pathlib.Path instead of os.path functions (#188)Stephen Brown IIbefore adoptionfde30b8

line 30why, one step back
30 return [str(path.parent) for path in Path(package).glob("**/__init__.py")]

Version 0.0.2Tom Christiebefore adoption7bd9f32

lines 31–33why, one step back
31
3233setup(

Rename -> httpxTom Christiebefore adoption219ece0

line 34why, one step back
34 name="httpx",

Version 0.0.2Tom Christiebefore adoption7bd9f32

line 35why, one step back
35 python_requires=">=3.6",

Rename -> httpxTom Christiebefore adoption219ece0

lines 36–37why, one step back
36 version=get_version("httpx"),
37 url="https://github.com/encode/httpx",

Version 0.0.2Tom Christiebefore adoption7bd9f32

line 38why, one step back
38 license="BSD",

http3 (#86)Tom Christiebefore adoptionc9747aa

line 39why, one step back
39 description="The next generation HTTP client.",

Version 0.0.2Tom Christiebefore adoption7bd9f32

lines 40–43why, one step back
40 long_description=get_long_description(),
41 long_description_content_type="text/markdown",42 author="Tom Christie",43 author_email="tom@tomchristie.com",

Enable mypy to discover type hints as specified in PEP 561 (#194)Andrew M. Whitebefore adoptionc7a5ce7

line 44why, one step back
44 package_data={"httpx": ["py.typed"]},

Rename -> httpxTom Christiebefore adoption219ece0

line 45why, one step back
45 packages=get_packages("httpx"),

Add idna support. More tests.Tom Christiebefore adoptionb948798

lines 46–50why, one step back
46 install_requires=[
47 "certifi",48 "chardet==3.*",49 "h11==0.8.*",50 "h2==3.*",

Switch hosts on HSTS preload to HTTPS (#151)Seth Michael Larsonbefore adoption3ba2e8c

line 51why, one step back
51 "hstspreload",

Add idna support. More tests.Tom Christiebefore adoptionb948798

line 52why, one step back
52 "idna==2.*",

Start using flake8, fix lint issues (#126)Seth Michael Larsonbefore adoptionc1044ca

line 53why, one step back
53 "rfc3986==1.*",

Add idna support. More tests.Tom Christiebefore adoptionb948798

line 54why, one step back
54 ],

Version 0.0.2Tom Christiebefore adoption7bd9f32

lines 55–67why, one step back
55 classifiers=[
56 "Development Status :: 3 - Alpha",57 "Environment :: Web Environment",58 "Intended Audience :: Developers",59 "License :: OSI Approved :: BSD License",60 "Operating System :: OS Independent",61 "Topic :: Internet :: WWW/HTTP",62 "Programming Language :: Python :: 3",63 "Programming Language :: Python :: 3.6",64 "Programming Language :: Python :: 3.7",65 "Programming Language :: Python :: 3.8",66 ],67)