File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22import os
3- import re
43
54from setuptools import find_packages , setup
65
76with open (os .path .join (os .path .dirname (__file__ ), "README.rst" )) as f :
87 long_description = f .read ()
98
109
11- def get_version (package ):
12- """
13- Return package version as listed in `__version__` in `__init__.py`.
14- """
15- path = os .path .join (os .path .dirname (__file__ ), "src" , package , "__init__.py" )
16- with open (path , "rb" ) as f :
17- init_py = f .read ().decode ("utf-8" )
18- return re .search ("__version__ = ['\" ]([^'\" ]+)['\" ]" , init_py ).group (1 )
19-
20-
2110setup (
2211 name = "prompt_toolkit" ,
2312 author = "Jonathan Slenders" ,
24- version = get_version ( "prompt_toolkit" ) ,
13+ version = "3.0.50" ,
2514 url = "https://github.com/prompt-toolkit/python-prompt-toolkit" ,
2615 description = "Library for building powerful interactive command lines in Python" ,
2716 long_description = long_description ,
Original file line number Diff line number Diff line change 1717from __future__ import annotations
1818
1919import re
20+ from importlib import metadata
2021
2122# note: this is a bit more lax than the actual pep 440 to allow for a/b/rc/dev without a number
2223pep440 = re .compile (
2829from .shortcuts import PromptSession , print_formatted_text , prompt
2930
3031# Don't forget to update in `docs/conf.py`!
31- __version__ = "3.0.50"
32+ __version__ = metadata . version ( "prompt_toolkit" )
3233
3334assert pep440 .match (__version__ )
3435
You can’t perform that action at this time.
0 commit comments