-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated codebase to fmcore, added Ruff formatter, and GitHub workflows.
- Loading branch information
1 parent
3575c6d
commit 481f7c6
Showing
170 changed files
with
5,875 additions
and
47,505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Linting | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
ruff-formatter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: astral-sh/ruff-action@v3 | ||
with: | ||
version: '0.9.2' | ||
args: format --check | ||
src: './src' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: release | ||
|
||
on: | ||
release: | ||
types: | ||
- published # Published through GitHub UI: https://github.com/amazon-science/synthesizrr/releases/new | ||
|
||
jobs: | ||
pypi: | ||
runs-on: ubuntu-latest | ||
if: > | ||
${{ github.event.workflow_run.conclusion == 'success' && | ||
github.event.workflow_run.head_branch == 'main' }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Required for Git versioning | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install Hatch & Twine | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install uv | ||
python -m uv pip install hatch twine | ||
- name: Verify Version from Git Tag | ||
run: hatch version | ||
|
||
- name: Build Package | ||
run: hatch build | ||
|
||
- name: Publish to Test PyPI | ||
env: | ||
TWINE_USERNAME: "__token__" | ||
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
run: twine upload --repository testpypi dist/* | ||
|
||
- name: Publish to PyPI | ||
env: | ||
TWINE_USERNAME: "__token__" | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: twine upload --repository pypi dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install test requirements | ||
# Install package dependencies: | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade uv | ||
python -m uv pip install --upgrade pytest | ||
python -m uv pip install -e . | ||
- name: Run tests | ||
run: | | ||
pytest tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[build-system] | ||
requires = ["hatchling", "hatch-vcs"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "synthesizrr" | ||
dynamic = ["version"] | ||
authors = [ | ||
{ name = "Abhishek Divekar", email = "[email protected]" } | ||
] | ||
description = "Synthesizing realistic and diverse text-datasets from augmented LLMs." | ||
readme = "README.md" | ||
requires-python = ">=3.11" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent", | ||
] | ||
license-files = ["LICENSE"] | ||
dependencies = [ | ||
"fmcore[all]", | ||
] | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
|
||
[tool.pytest.ini_options] | ||
pythonpath = ["src"] | ||
|
||
[tool.ruff] | ||
line-length = 110 | ||
fix = true | ||
force-exclude = true | ||
extend-exclude = [ | ||
"__init__.py", | ||
] | ||
|
||
[tool.ruff.lint] | ||
fixable = [ | ||
"I", # Add all rules under isort linter: https://docs.astral.sh/ruff/rules/#isort-i | ||
"W", # Add all rules under whitespace: https://docs.astral.sh/ruff/rules/#warning-w | ||
"E401", # multiple-imports-on-one-line: https://docs.astral.sh/ruff/rules/multiple-imports-on-one-line/ | ||
"E713", # not-in-test: https://docs.astral.sh/ruff/rules/not-in-test/ | ||
"E721", # type-comparison: https://docs.astral.sh/ruff/rules/type-comparison/ | ||
"E722", # bare-except: https://docs.astral.sh/ruff/rules/bare-except/ | ||
"F401", # unused-import: https://docs.astral.sh/ruff/rules/unused-import/ | ||
"F541", # f-string-missing-placeholders: https://docs.astral.sh/ruff/rules/f-string-missing-placeholders/ | ||
"F811", # redefined-while-unused: https://docs.astral.sh/ruff/rules/redefined-while-unused/ | ||
"F841", # unused-variable: https://docs.astral.sh/ruff/rules/unused-variable/ | ||
] | ||
ignore = [ | ||
## Ignored because it makes the code too verbose: | ||
"E731", # lambda-assignment: https://docs.astral.sh/ruff/rules/lambda-assignment/ | ||
"E741", # ambiguous-variable-name: https://docs.astral.sh/ruff/rules/ambiguous-variable-name/ | ||
|
||
## Ignored because of bad interaction with `from typing import *` | ||
"F405", # undefined-local-with-import-star-usage: https://docs.astral.sh/ruff/rules/undefined-local-with-import-star-usage/ | ||
"F403", # undefined-local-with-import-star: https://docs.astral.sh/ruff/rules/undefined-local-with-import-star/ | ||
] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.