Commit 342de41c by Sébastien Eustace

Change the way version is retrieved in setup.py

parent 2f41bbb0
......@@ -4,7 +4,7 @@ python:
- "3.6"
install:
- python setup.py develop
- pip install -e .
- poetry install
script: pytest -q tests/
__version__ = '0.2.0'
from pathlib import Path
from .__version__ import __version__
from .packages import Locker
from .packages import Package
from .repositories import Pool
......@@ -10,7 +11,7 @@ from .utils.toml_file import TomlFile
class Poetry:
VERSION = '0.2.0'
VERSION = __version__
def __init__(self,
file: Path,
......
......@@ -4,8 +4,8 @@ from setuptools import setup, find_packages
def get_version():
basedir = os.path.dirname(__file__)
with open(os.path.join(basedir, 'poetry/__init__.py')) as f:
variables = {'__name__': 'poetry'}
with open(os.path.join(basedir, 'poetry/__version__.py')) as f:
variables = {}
exec(f.read(), variables)
version = variables.get('__version__')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment