From f075ebc062af856138a3deabc781d9139544c9b3 Mon Sep 17 00:00:00 2001 From: Ameya Ketkar <94497232+ketkarameya@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:43:18 -0700 Subject: [PATCH] Update the plugin --- .gitignore | 1 + plugins/pyproject.toml | 25 +++++++++++++++++++++++ plugins/scala_test/README.md | 19 ++++++++++++++++++ plugins/scala_test/main.py | 3 --- plugins/setup.py | 39 ------------------------------------ 5 files changed, 45 insertions(+), 42 deletions(-) create mode 100644 plugins/pyproject.toml create mode 100644 plugins/scala_test/README.md delete mode 100644 plugins/setup.py diff --git a/.gitignore b/.gitignore index 29e3930f6..0694fd045 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ target Cargo.lock tmp_test* env/ +**.egg-info # Dependencies diff --git a/plugins/pyproject.toml b/plugins/pyproject.toml new file mode 100644 index 000000000..c4c679100 --- /dev/null +++ b/plugins/pyproject.toml @@ -0,0 +1,25 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.poetry] +name = "scala_test" +version = "0.0.1" +description = "Rules to migrate 'scaletest'" +# Add any other metadata you need + +[tool.poetry.dependencies] +python = "^3.9" +polyglot_piranha = "*" + +[tool.poetry.dev-dependencies] +pytest = "*" + +# [tool.poetry.scripts] +# scala_test = "scala_test.main:main" + +[tool.poetry.scripts."scala_test"] +main = "scala_test.main:main" + +[tool.poetry.scripts."pytest"] +main = "pytest" diff --git a/plugins/scala_test/README.md b/plugins/scala_test/README.md new file mode 100644 index 000000000..2d205730c --- /dev/null +++ b/plugins/scala_test/README.md @@ -0,0 +1,19 @@ +# `scalatest` Migration Plugin + +## Usage: +``` +python3 plugins/scala_test/main.py -h +usage: main.py [-h] --path_to_codebase PATH_TO_CODEBASE + +Migrates scala tests!!! + +options: + -h, --help show this help message and exit + --path_to_codebase PATH_TO_CODEBASE + Path to the codebase directory. +``` + +## Test +``` +pytest plugins/scala_test +``` diff --git a/plugins/scala_test/main.py b/plugins/scala_test/main.py index 6f7eb58f7..42249aa4b 100644 --- a/plugins/scala_test/main.py +++ b/plugins/scala_test/main.py @@ -1,9 +1,6 @@ import argparse from update_imports import update_imports - - - def _parse_args(): parser = argparse.ArgumentParser(description="Migrates scala tests!!!") parser.add_argument( diff --git a/plugins/setup.py b/plugins/setup.py deleted file mode 100644 index 5f72c7ac4..000000000 --- a/plugins/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2023 Uber Technologies, Inc. -# -#

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of the License at -#

http://www.apache.org/licenses/LICENSE-2.0 -# -#

Unless required by applicable law or agreed to in writing, software distributed under the -# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -# express or implied. See the License for the specific language governing permissions and -# limitations under the License. - -from setuptools import find_packages, setup - -setup( - name="scala_test", - version="0.0.1", - description="Rules to migrate `scaletest`", - # long_description=open("README.md").read(), - # long_description_content_type="text/markdown", - # url="https://github.com/uber/piranha", - packages=find_packages(), - include_package_data=True, - install_requires=[ - # "polyglot-piranha", - "pytest", - ], - entry_points={ - "console_scripts": ["scala_test = scala_test.main:main"] - }, - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - ], - python_requires=">=3.9", - tests_require=["pytest"], - # Define the test suite - test_suite="tests", -)