Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename package to instructlab.sdg from instructlab_sdg #14

Merged
merged 1 commit into from
Jun 10, 2024
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated
src/instructlab_sdg/_version.py
src/instructlab/sdg/_version.py

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ source = "https://github.com/instructlab/sdg"
issues = "https://github.com/instructlab/sdg/issues"

[tool.setuptools_scm]
version_file = "src/instructlab_sdg/_version.py"
version_file = "src/instructlab/sdg/_version.py"
# do not include +gREV local version, required for Test PyPI upload
local_scheme = "no-local-version"

Expand All @@ -50,7 +50,7 @@ dependencies = {file = ["requirements.txt"]}

[tool.setuptools.packages.find]
where = ["src"]
include = ["sdg"]
include = ["instructlab.sdg"]

[tool.setuptools.package-data]
"instructlab.schema.v1" = ["*.json"]
Expand Down Expand Up @@ -107,8 +107,8 @@ known-local-folder = ["tuning"]
[tool.mypy]
disable_error_code = ["import-not-found", "import-untyped"]
exclude = [
"^src/instructlab_sdg/generate_data\\.py$",
"^src/instructlab_sdg/utils\\.py$",
"^src/instructlab/sdg/generate_data\\.py$",
"^src/instructlab/sdg/utils\\.py$",
]
# honor excludes by not following there through imports
follow_imports = "silent"
1 change: 1 addition & 0 deletions src/instructlab/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
Copy link
Contributor

@bjhargrave bjhargrave Jun 7, 2024

Choose a reason for hiding this comment

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

Is this __init__.py needed here?

This will allow some portions of a namespace to be legacy portions while others are migrated to PEP 420.

https://peps.python.org/pep-0420/#migrating-from-legacy-namespace-packages

indicates (to me) that it is not necessary in the PEP 420 parts of the namespace (like this and instructlab.schema) to have an instructlab/__init__.py.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's needed for now until we have reconfigured all tooling and linters to deal with PEP 420 namespace packages.

File renamed without changes.
3 changes: 3 additions & 0 deletions src/instructlab/sdg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# First party
# First Party
from instructlab.sdg.generate_data import generate_data
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import time

# Third Party
# instructlab - All of these need to go away - issue #6
# instructlab - All of these need to go away (other than sdg) - issue #6
from instructlab.config import get_model_family
from instructlab.utils import (
chunk_document,
Expand All @@ -28,7 +28,8 @@
import tqdm

# First Party
from instructlab_sdg import utils
# pylint: disable=ungrouped-imports
from instructlab.sdg import utils

DEFAULT_PROMPT_TEMPLATE_MERLINITE = """\
You are asked to come up with a set of 5 diverse task instructions under {{taxonomy}}{{" for the task \\"%s\\""|format(task_description) if task_description}}. These task instructions will be given to a GPT model and we will evaluate the GPT model for completing the instructions.
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions src/instructlab_sdg/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ skip_install = true
skipsdist = true
deps = -r requirements-dev.txt
commands =
{envpython} -m pylint --load-plugins pylint_pydantic src/instructlab_sdg/
{envpython} -m pylint --load-plugins pylint_pydantic src/instructlab/sdg/

[testenv:fastlint]
description = fast lint with pylint (without 3rd party modules)
Expand All @@ -24,7 +24,7 @@ deps =
pylint
pylint-pydantic
commands =
{envpython} -m pylint --load-plugins pylint_pydantic {posargs:--disable=import-error src/instructlab_sdg/}
{envpython} -m pylint --load-plugins pylint_pydantic {posargs:--disable=import-error src/instructlab/sdg/}

[testenv:ruff]
description = reformat and fix code with Ruff (and isort)
Expand Down