Commit 342de41c by Sébastien Eustace

Change the way version is retrieved in setup.py

parent 2f41bbb0
...@@ -4,7 +4,7 @@ python: ...@@ -4,7 +4,7 @@ python:
- "3.6" - "3.6"
install: install:
- python setup.py develop - pip install -e .
- poetry install - poetry install
script: pytest -q tests/ script: pytest -q tests/
__version__ = '0.2.0'
from pathlib import Path from pathlib import Path
from .__version__ import __version__
from .packages import Locker from .packages import Locker
from .packages import Package from .packages import Package
from .repositories import Pool from .repositories import Pool
...@@ -10,7 +11,7 @@ from .utils.toml_file import TomlFile ...@@ -10,7 +11,7 @@ from .utils.toml_file import TomlFile
class Poetry: class Poetry:
VERSION = '0.2.0' VERSION = __version__
def __init__(self, def __init__(self,
file: Path, file: Path,
......
...@@ -4,8 +4,8 @@ from setuptools import setup, find_packages ...@@ -4,8 +4,8 @@ from setuptools import setup, find_packages
def get_version(): def get_version():
basedir = os.path.dirname(__file__) basedir = os.path.dirname(__file__)
with open(os.path.join(basedir, 'poetry/__init__.py')) as f: with open(os.path.join(basedir, 'poetry/__version__.py')) as f:
variables = {'__name__': 'poetry'} variables = {}
exec(f.read(), variables) exec(f.read(), variables)
version = variables.get('__version__') 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