fixup! Add standard python build files

This commit is contained in:
Cédric Leporcq 2021-10-30 12:48:39 +02:00
parent 9ec95d99f1
commit bfb2153eb8
5 changed files with 50 additions and 19 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
import os
from pathlib import Path
import re
import sys

3
setup.py Normal file
View File

@ -0,0 +1,3 @@
from setuptools import setup
setup()

34
tests/test_cli.py Normal file
View File

@ -0,0 +1,34 @@
from imp import load_source
from pathlib import Path
from click.testing import CliRunner
import pytest
import sys
CONTENT = "content"
import ipdb; ipdb.set_trace()
ordigi = load_source('cli', str(Path(__file__).parent.parent) + 'cli.py')
class TestOrdigi:
@pytest.fixture(autouse=True)
def setup_class(cls, sample_files_paths):
cls.runner = CliRunner()
cls.src_path, cls.file_paths = sample_files_paths
def test__sort(self):
import ipdb; ipdb.set_trace()
result = self.runner.invoke(cli._sort, [str(self.src_path)])
def test_needsfiles(tmpdir):
assert tmpdir
def test_create_file(tmp_path):
directory = tmp_path / "sub"
directory.mkdir()
path = directory / "hello.txt"
path.write_text(CONTENT)
assert path.read_text() == CONTENT
assert len(list(tmp_path.iterdir())) == 1

View File

@ -1,19 +0,0 @@
import pytest
CONTENT = "content"
class TestOrdigi:
@pytest.mark.skip()
def test__sort(self):
assert 0
def test_needsfiles(tmpdir):
assert tmpdir
def test_create_file(tmp_path):
d = tmp_path / "sub"
d.mkdir()
p = d / "hello.txt"
p.write_text(CONTENT)
assert p.read_text() == CONTENT
assert len(list(tmp_path.iterdir())) == 1

12
workflow.sh Normal file
View File

@ -0,0 +1,12 @@
# Create virtual environment
nmkvirtualenv ordigi
# Work on it (activate and cd)
workon ordigi
# Install required dependencies
pip install -r requirements.txt
# Install it
pip install -e .