Skip to content

Commit

Permalink
[fundamental] Redirect dev setup script (microsoft#2500)
Browse files Browse the repository at this point in the history
# Description

This PR targets to redirect dev setup script to the new one that is
compatible with promptflow packages.

# All Promptflow Contribution checklist:
- [x] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [x] Title of the pull request is clear and informative.
- [x] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.
  • Loading branch information
zhengfeiwang authored Mar 27, 2024
1 parent e301780 commit 36c5c91
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 49 deletions.
6 changes: 1 addition & 5 deletions docs/dev/dev_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
- First create a new [conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html) environment. Please specify python version as 3.9.
`conda create -n <env_name> python=3.9`.
- Activate the env you created.
- Set environment variable `PYTHONPATH` in your new conda environment.
`conda env config vars set PYTHONPATH=<path-to-src>\promptflow`.
Once you have set the environment variable, you have to reactivate your environment.
`conda activate <env_name>`.
- In root folder, run `python scripts/building/dev_setup.py --promptflow-extra-deps azure` to install the package and dependencies.
- In root folder, run `python scripts/dev-setup/main.py` to install the packages and dependencies.

## How to run tests

Expand Down
43 changes: 0 additions & 43 deletions scripts/building/dev_setup.py

This file was deleted.

8 changes: 7 additions & 1 deletion scripts/dev-setup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

PROMPT_FLOW_PKGS = [
"promptflow-tracing",
# TODO: uncomment below lines when the packages are ready
"promptflow-core",
# TODO: uncomment below lines when the packages are ready
# "promptflow-devkit",
# "promptflow-azure",
"promptflow[azure]",
Expand Down Expand Up @@ -97,6 +97,12 @@ def install_pkg_editable(pkg: str, verbose: bool) -> None:
elif os.path.exists("pyproject.toml"):
collect_and_install_from_pyproject()

# touch __init__.py for the package
# NOTE that this is a workaround to enable VS Code to recognize the namespace package
# we should be able to remove this after we fully deprecate promptflow in local development
with open(pkg_working_dir / "promptflow" / "__init__.py", mode="w", encoding="utf-8") as f:
f.write("")


@dataclass
class Arguments:
Expand Down

0 comments on commit 36c5c91

Please sign in to comment.