File tree Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Original file line number Diff line number Diff line change 11import setuptools
22import pathlib
33import pkg_resources
4- import importlib .util
5- import os
64
75# get version from version.py
8- spec = importlib .util .spec_from_file_location (
9- "pyfuncserver.version" , os .path .join ("version.py" )
10- )
11-
12- v_module = importlib .util .module_from_spec (spec )
13- spec .loader .exec_module (v_module )
14-
15- version = v_module .VERSION
6+ with pathlib .Path ("version.py" ).open () as version_py :
7+ _locals = locals ()
8+ exec (version_py .read (), globals (), _locals )
9+ version = _locals ["VERSION" ]
1610
1711with pathlib .Path ("requirements.txt" ).open () as requirements_txt :
1812 requirements = [
Original file line number Diff line number Diff line change 11import setuptools
22import pathlib
33import pkg_resources
4- import importlib .util
5- import os
64
75# get version from version.py
8- spec = importlib .util .spec_from_file_location (
9- "pyfuncserver.version" , os .path .join ("version.py" )
10- )
11-
12- v_module = importlib .util .module_from_spec (spec )
13- spec .loader .exec_module (v_module )
14-
15- version = v_module .VERSION
6+ with pathlib .Path ("version.py" ).open () as version_py :
7+ _locals = locals ()
8+ exec (version_py .read (), globals (), _locals )
9+ version = _locals ["VERSION" ]
1610
1711with pathlib .Path ("requirements.txt" ).open () as requirements_txt :
1812 requirements = [
You can’t perform that action at this time.
0 commit comments