Skip to content

Commit

Permalink
refactor: move setup modules to the root
Browse files Browse the repository at this point in the history
  • Loading branch information
lpm0073 committed Nov 28, 2023
1 parent 94dbbfa commit 9d33b3d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ activate:

test:
cd grader && pytest -v -s tests/
cd grader && python -m setup_test
python -m setup_test

lint:
pre-commit run --all-files && \
black .

clean:
rm -rf venv
rm -rf venv && rm -rf node_modules


######################
Expand Down
5 changes: 3 additions & 2 deletions grader/setup.py → setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
"""Setup for automated_grader package."""
from setup_utils import get_semantic_version # pylint: disable=import-error
from setuptools import find_packages, setup

from setup_utils import get_semantic_version # pylint: disable=import-error


setup(
name="automated_grader",
Expand All @@ -12,7 +13,7 @@
author_email="[email protected]",
packages=find_packages(),
package_data={
"automated_grader": ["*.md", "data/*"],
"automated_grader": ["*.md"],
},
install_requires=[],
)
File renamed without changes.
3 changes: 2 additions & 1 deletion grader/setup_utils.py → setup_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@


HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.abspath(os.path.join(HERE, "grader"))

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))


def load_version() -> Dict[str, str]:
"""Stringify the __version__ module."""
version_file_path = os.path.join(HERE, "__version__.py")
version_file_path = os.path.join(PROJECT_ROOT, "__version__.py")
spec = importlib.util.spec_from_file_location("__version__", version_file_path)
version_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)
Expand Down

0 comments on commit 9d33b3d

Please sign in to comment.