From 7d18036510aa1702f40d9769d70e3bf2da0bd2e3 Mon Sep 17 00:00:00 2001 From: Steven Mi Date: Wed, 9 Aug 2023 23:56:47 +0800 Subject: [PATCH 1/3] chore: add markdown description to pypi package --- CHANGELOG.md | 4 ++++ setup.py | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ee37f7..405dd77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog db-rocket +## Version 1.3.1 + +- Adding Markdown documentation to package description + ## Version 1.3.0 - Remove `rocket trigger` CLI diff --git a/setup.py b/setup.py index 494453a..d812646 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,22 @@ import setuptools +# load the README file and use it as the long_description for PyPI +with open("README.md", encoding="utf8") as f: + readme = f.read() + setuptools.setup( name="databricks-rocket", - version="1.3.0", + version="1.3.1", author="GetYourGuide", author_email="engineering.data-products@getyourguide.com", description="Keep your local python scripts installed and in sync with a databricks notebook. Shortens the feedback loop to develop projects using a hybrid enviroment", - url="https://github.com/getyourguide/databricks-rocket", + long_description=readme, + long_description_content_type="text/markdown", + url="https://github.com/getyourguide/db-rocket", packages=setuptools.find_packages(), install_requires=["fire", "watchdog~=2.1.9", "build", "databricks_cli"], entry_points={ "console_scripts": ["rocket=rocket.rocket:main", "dbrocket=rocket.rocket:main"] }, + license="Apache 2.0", ) From 27c192b5b134401f16b529ba5c8553f2e3b21cd8 Mon Sep 17 00:00:00 2001 From: Steven Mi Date: Thu, 10 Aug 2023 00:02:29 +0800 Subject: [PATCH 2/3] chore: refine print statements --- rocket/rocket.py | 15 +++++++-------- setup.py | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/rocket/rocket.py b/rocket/rocket.py index a24ffae..eaebcbf 100644 --- a/rocket/rocket.py +++ b/rocket/rocket.py @@ -110,7 +110,7 @@ def _deploy(self, watch, modified_files): if modified_files: logger.info(f"Found changes in {modified_files}. Overwriting them.") for file in modified_files: - logger.info(f"Sync {file}") + logger.info(f"Finished sync of {file}") execute_shell_command( f"databricks fs cp --recursive --overwrite {file} {self.dbfs_folder}/{os.path.relpath(file, self.project_location)}" ) @@ -119,6 +119,7 @@ def _deploy(self, watch, modified_files): f"databricks fs cp --overwrite {self.wheel_path} {self.dbfs_folder}/{self.wheel_file}" ) if watch: + logger.info("You have watch activated. Your project will be automatically synchronised with databricks. Starting sync process:") package_dirs = extract_python_package_dirs(self.project_location) for package_dir in package_dirs: python_files = extract_python_files_from_folder(package_dir) @@ -127,7 +128,7 @@ def helper(file): execute_shell_command( f"databricks fs cp --recursive --overwrite {file} {self.dbfs_folder}/{os.path.relpath(file, self.project_location)}" ) - logger.info(f"Sync {file}") + logger.info(f"Finished sync of {file}") execute_for_each_multithreaded(python_files, helper) except Exception as e: raise Exception( @@ -139,23 +140,21 @@ def helper(file): install_cmd = _add_index_urls_to_cmd(install_cmd, self.index_urls) project_name = extract_project_name_from_wheel(self.wheel_file) - if modified_files: - logger.info("Changes are applied") - elif watch: + if watch: logger.info( - f"""You have watch activated. Your project will be automatically synchronised with databricks. Add following in one cell: + f"""Sync completed. To use your library in your databricks notebook & automatically apply local changes add following in one cell: %pip install --upgrade pip %pip install {install_cmd} --force-reinstall %pip uninstall -y {project_name} -and then in new Python cell: +and then in a new Python cell: %load_ext autoreload %autoreload 2 import sys import os sys.path.append(os.path.abspath('{base_path}')""") else: - logger.info(f"""Install your library in your databricks notebook by running: + logger.info(f"""Uploaded your library to databricks. Install your library in your databricks notebook by running: %pip install --upgrade pip %pip install {install_cmd} --force-reinstall""") diff --git a/setup.py b/setup.py index d812646..b4dbdda 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name="databricks-rocket", - version="1.3.1", + version="1.3.2", author="GetYourGuide", author_email="engineering.data-products@getyourguide.com", description="Keep your local python scripts installed and in sync with a databricks notebook. Shortens the feedback loop to develop projects using a hybrid enviroment", From 3b956144efac0186af7ea3d15779096a19f068dd Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 10 Aug 2023 00:09:05 +0800 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 405dd77..015ae53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog db-rocket +## Version 1.3.2 + +- Refine prints to be more clear + ## Version 1.3.1 - Adding Markdown documentation to package description