Skip to content

Commit

Permalink
fix setup
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Sep 19, 2024
1 parent 4b21d93 commit d7da345
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
25 changes: 17 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
import typing
import re
from pathlib import Path

from setuptools import find_packages, setup


THIS_FILE = Path(__file__)

# Load version number without importing HABApp
def load_version() -> str:
version: typing.Dict[str, str] = {}
with open('src/HABApp/__version__.py') as fp:
exec(fp.read(), version)
version: dict[str, str] = {}
exec((THIS_FILE.parent / 'src/HABApp/__version__.py').read_text(), version)
assert version['__version__'], version
return version['__version__']


def load_req() -> typing.List[str]:
with open('requirements_setup.txt') as f:
return f.readlines()
def load_req() -> list[str]:

lines = THIS_FILE.with_name('requirements_setup.txt').read_text().splitlines()
print(lines)

for i, line in enumerate(lines):
if m := re.search(r'([^/]+).git@\w', line):
lines[i] = f'{m.group(1):s} @ {line:s}'
print(f'Modified: {lines[i]}')
return lines


__version__ = load_version()

print(f'Version: {__version__}')
print('')
print()


# When we run tox tests we don't have these files available, so we skip them
readme = Path(__file__).with_name('readme.md')
Expand Down
7 changes: 3 additions & 4 deletions tests/rule_runner/test_rule_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ def say_something(self):
proc.kill()
stdout, stderr = proc.communicate()

print('')
print('Standard Output:', stdout)
print('Standard Error:', stderr)

if err:
print('')
print('Standard Output:', stdout)
print('Standard Error:', stderr)
pytest.fail('Error')


Expand Down

0 comments on commit d7da345

Please sign in to comment.