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

install-testplan-ui is missing with venv+pip install #861

Open
havasd opened this issue Sep 30, 2022 · 4 comments
Open

install-testplan-ui is missing with venv+pip install #861

havasd opened this issue Sep 30, 2022 · 4 comments

Comments

@havasd
Copy link
Contributor

havasd commented Sep 30, 2022

My python version is 3.10.6.

I am trying to install testplan on my local environment. However during following the steps from here the install-testplan-ui script is missing. It seems like it didn't pull that file along with the pip package.

Additionally in the commands needs to be upgraded as the python3.7 package is deprecated also without python3-venv package the venv doesn't work properly.
So I had to use this command sudo apt-get install python3 python3-pip python3-venv python-is-python3 rsync
I have added python-is-python3 as that simplifies the interpreters.

I presume missing the install-testplan-ui causes the interactive mode to fail.

@M6AI
Copy link
Contributor

M6AI commented Sep 30, 2022

Hi @havasd thanks for reporting. Let us look into this and get back to you ASAP.

@havasd
Copy link
Contributor Author

havasd commented Sep 30, 2022

Additionally it seems typing_extensions dependency is missing as well

I started to fix it a bit however after that I run into some dependency hell with npm packages.

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating

Here is a patch about my changes so far:

diff --git a/setup.py b/setup.py
index 1dba5b73..10d5d772 100644
--- a/setup.py
+++ b/setup.py
@@ -31,6 +31,7 @@ REQUIRED = [
     "requests>=2.4.3",
     "flask>2.0.0",
     "werkzeug>2.0.0,<2.2.0",
+    "typing_extensions",
     "flask_restx",
     "cheroot",
     "boltons",
@@ -88,5 +89,7 @@ setup(
     package_data={"testplan.web_ui": ui_files},
     install_requires=REQUIRED,
     python_requires=">=3.7",
-    entry_points={"console_scripts": ["tpsreport=testplan.cli.tpsreport:cli"]},
+    entry_points={"console_scripts": [
+        "tpsreport=testplan.cli.tpsreport:cli",
+        "install_testplan_ui=testplan.web_ui.install_testplan_ui:main"]},
 )
diff --git a/install-testplan-ui b/testplan/web_ui/install_testplan_ui.py
similarity index 99%
rename from install-testplan-ui
rename to testplan/web_ui/install_testplan_ui.py
index 05ac961a..e7d50e2a 100755
--- a/install-testplan-ui
+++ b/testplan/web_ui/install_testplan_ui.py
@@ -130,7 +130,9 @@ def install_and_build_ui(
         )
     logging.info("Testplan UI install & build have completed successfully.")
 
-
-if __name__ == "__main__":
+def main():
     args = parse_cli_args()
     install_and_build_ui(path=args.path, dev=args.dev, verbose=args.verbose)
+
+if __name__ == "__main__":
+    main()

@M6AI
Copy link
Contributor

M6AI commented Oct 4, 2022

Sorry for the delayed reply @havasd . I downloaded https://github.com/morganstanley/testplan/archive/main.zip on my end and there is an install-testplan-ui script involved in the archive. Just to clarify is your concern that it is missing or that it misses the .py extension?

Concerning npm, we moved to pnpm since the spring of 2022, it may not be reflected accordingly in docs. Version is 6.30.1, see https://github.com/morganstanley/testplan/blob/main/.github/actions/build-package/action.yml#L12-L22 and https://github.com/morganstanley/testplan/blob/main/.github/workflows/test_pr.yml#L93-L96 for more details. Pre-post scripts are identical to npm, so pnpm install, pnpm build, pnpm run, ... all should work.

@havasd
Copy link
Contributor Author

havasd commented Oct 4, 2022

I was using the pip based steps: https://testplan.readthedocs.io/en/latest/getting_started.html#using-a-virtualenv
So the result of the pip install https://github.com/morganstanley/testplan/archive/main.zip command misses that file, not when I download the archive with wget or some other means

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants