Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/PR_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.10.5'

- name: Ensure VERSION file exists
run: |
if [ ! -f VERSION ]; then echo "0.1.0" > VERSION; fi
- name: Install Python dependencies
run: |
pip install -e .[test] # Install dependencies, including testing requirements

- name: install pytest coverage
run: |
pip install -e .[test] pytest-cov # Ensure pytest-cov is installed
pip install pytest-cov # Ensure pytest-cov is installed

- name: Run Flake8 for PEP8 compliance
run: |
flake8 --count src # Check code for PEP8 compliance in the 'src' directory
flake8 --count elabforms # Check code for PEP8 compliance in the 'src' directory
- name: Run pytest for unit tests
run: |
pytest --cov=src tests/ # Run unit tests and measure coverage
pytest --cov=elabforms tests/ # Run unit tests and measure coverage
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.0.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no new functionalities, so the version number should remain identical: 0.0.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ,i would liké to use 0.0.1 but its not possible due to former attemps on Testpypy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, ok!

File renamed without changes.
2 changes: 1 addition & 1 deletion src/cli.py → elabforms/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from template_builder import TemplateBuilder
from .template_builder import TemplateBuilder


def main():
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/template_builder.py → elabforms/template_builder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import csv
from template_part import TemplatePart
from template import Template
from .template_part import TemplatePart
from .template import Template


class TemplateBuilder:
Expand Down
2 changes: 1 addition & 1 deletion src/template_part.py → elabforms/template_part.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from template import Template
from .template import Template


class TemplatePart(Template):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest~=7.4.4
#pytest~=7.4.4
gitpython
PyYAML~=6.0.1
setuptools~=68.2.0
Expand Down
23 changes: 10 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
from setuptools import setup, find_packages
import os

with open(os.path.join(os.path.dirname(__file__), "VERSION")) as version_file:
root_dir = os.path.abspath(os.path.dirname(__file__))

with open(os.path.join(root_dir, "VERSION")) as version_file:
version = version_file.read().strip()

with open('requirements.txt') as f:
with open(os.path.join(root_dir, 'requirements.txt')) as f:
requires = f.read().splitlines()

with open('README.md') as f:
with open(os.path.join(root_dir, 'README.md')) as f:
long_description = f.read()

setup(
name="elabforms",
version=version,
packages=find_packages(where="src"),
package_dir={"": "src"},
package_data={
"": ["*.json", "*.csv", "*.zip"],
},
data_files=[('elabforms', ['VERSION', 'README.md', 'requirements.txt'])],
author=" Fatai Idrissou, Sylvain Takerkart",
packages=find_packages(where="."),
author="Fatai Idrissou, Sylvain Takerkart",
description="A set of tools to create and manage standardized forms for eLabFTW",
long_description_content_type="text/markdown",
long_description=long_description,
long_description_content_type="text/markdown",
license='MIT',
install_requires=requires,
include_package_data=True,
python_requires='>=3.8',
extras_require={
'test': ['pytest', 'flake8'], # Added flake8 for code style checking
'test': ['pytest', 'flake8'],
},
entry_points={
"console_scripts": [
"eform=src.cli:main"
"eform=elabforms.cli:main"
],
},
)
Empty file removed src/exemple.py
Empty file.
2 changes: 0 additions & 2 deletions tests/test_exemple.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys


from template import Template # noqa: E402
from elabforms.template import Template # noqa: E402


class TestTemplate(unittest.TestCase):
Expand Down Expand Up @@ -113,4 +113,4 @@ def test_add_template_part(self):


if __name__ == "__main__":
unittest.main()
unittest.main()
10 changes: 5 additions & 5 deletions tests/test_template_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import json
import sys
# sys.path.insert(0, os.path.abspath(
# os.path.join(os.path.dirname(__file__), '../src')))
from template_builder import TemplateBuilder
from template_part import TemplatePart
from template import Template
# os.path.join(os.path.dirname(__file__), '../elabforms')))
from elabforms.template_builder import TemplateBuilder
from elabforms.template_part import TemplatePart
from elabforms.template import Template


class TestTemplateBuilder(unittest.TestCase):
Expand Down Expand Up @@ -102,4 +102,4 @@ def test_build_template(self):


if __name__ == "__main__":
unittest.main()
unittest.main()
6 changes: 3 additions & 3 deletions tests/test_template_part.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import sys

# sys.path.insert(0, os.path.abspath(
# os.path.join(os.path.dirname(__file__), '../src')))
# os.path.join(os.path.dirname(__file__), '../elabforms')))

from template_part import TemplatePart
from elabforms.template_part import TemplatePart


class TestTemplatePart(unittest.TestCase):
Expand Down Expand Up @@ -82,4 +82,4 @@ def test_set_content_id(self):


if __name__ == "__main__":
unittest.main()
unittest.main()