Skip to content

Commit

Permalink
Refactor code inside src folder
Browse files Browse the repository at this point in the history
Signed-off-by: guillemdb <guillem@fragile.tech>
  • Loading branch information
Guillemdb committed Sep 4, 2022
1 parent 09b39fa commit 0c065c0
Show file tree
Hide file tree
Showing 70 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
PROJECT_NAME: mloq
PROJECT_DIR: mloq
PROJECT_DIR: src/mloq
VERSION_FILE: mloq/version.py
DEFAULT_BRANCH: master
BOT_NAME: fragile-bot
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
current_dir = $(shell pwd)

PROJECT = mloq
PROJECT = src/mloq
n ?= auto
DOCKER_ORG = fragiletech
DOCKER_TAG ?= ${PROJECT}
Expand Down
4 changes: 0 additions & 4 deletions mloq/assets/templates/WHAT_MLOQ_GENERATED.md

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ honor_noqa = true
# Code coverage config
[tool.coverage.run]
branch = true
source = ["mloq"]
source = ["src/mloq"]

[tool.coverage.report]
exclude_lines =["no cover",
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

version = SourceFileLoader(
"mloq.version",
str(Path(__file__).parent / "mloq" / "version.py"),
str(Path(__file__).parent / "src" / "mloq" / "version.py"),
).load_module()

with open(Path(__file__).with_name("README.md"), encoding="utf-8") as f:
Expand All @@ -18,7 +18,8 @@
description="Package for initializing ML projects following ML Ops best practices.",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
packages=find_packages("src"),
package_dir={"": "src"},
version=version.__version__,
license="MIT",
author="FragileTech",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ suppress_warnings = ["image.nonlocal_uri"]
autodoc_typehints = "description"
# Autoapi settings
autoapi_type = "python"
autoapi_dirs = ["../../{{docs.project_name}}"]
autoapi_dirs = ["../../src/{{docs.project_name}}"]
autoapi_add_toctree_entry = True
# Make use of custom templates
autoapi_template_dir = "_autoapi_templates"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ honor_noqa = true
# Code coverage config
[tool.coverage.run]
branch = true
source = ["{{lint.project_name}}"]
source = ["src/{{lint.project_name}}"]

[tool.coverage.report]
exclude_lines =["no cover",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mloq/commands/project.py → src/mloq/commands/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class ProjectCMD(Command):
def directories(self) -> Tuple[Path]:
"""Tuple containing Paths objects representing the directories created by the command."""
project_folder = self.record.config.project.project_name.replace(" ", "_")
return tuple([Path("src") / Path(project_folder), Path("tests")])
return tuple([Path("src") / project_folder, Path("tests")])

def record_files(self) -> None:
"""Register the files that will be generated by mloq."""
self.record.register_file(file=readme, path=Path())
self.record.register_file(file=makefile, path=Path())
project_folder = Path(self.record.config.project.project_name.replace(" ", "_"))
project_folder = Path("src") / self.record.config.project.project_name.replace(" ", "_")
description = "Python package header for the project module"
self.record.register_file(file=init, path=project_folder, description=description)
self.record.register_file(file=main, path=project_folder)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0c065c0

Please sign in to comment.