From 9cf64ae30697836eb9a8cf98dfbe0d5d0120c675 Mon Sep 17 00:00:00 2001 From: Jean-Robin Date: Wed, 23 Oct 2024 09:45:56 +0200 Subject: [PATCH] Feature/#1170 factorize installation contributing doc (#1175) * - update contributor step to read contributors from GitHub directly * - update contributor step to read contributors from GitHub directly - Factorize code of conduct, contributing, and installation pages - remove files to delete from gitignore * remove contributors.md --- .gitignore | 32 ++-- docs/contributing/code_of_conduct.md | 126 --------------- docs/contributing/code_of_conduct.md_template | 5 + docs/contributing/index.md | 150 ------------------ docs/contributing/index.md_template | 5 + .../tutorials/getting_started/installation.md | 121 -------------- .../getting_started/installation.md_template | 5 + tools/_setup_generation/setup.py | 17 ++ tools/_setup_generation/step_contributors.py | 36 ++--- .../_setup_generation/step_file_injection.py | 56 +++++++ tools/fetch_source_files.py | 32 ++-- 11 files changed, 138 insertions(+), 447 deletions(-) delete mode 100644 docs/contributing/code_of_conduct.md create mode 100644 docs/contributing/code_of_conduct.md_template delete mode 100644 docs/contributing/index.md create mode 100644 docs/contributing/index.md_template delete mode 100644 docs/tutorials/getting_started/installation.md create mode 100644 docs/tutorials/getting_started/installation.md_template create mode 100644 tools/_setup_generation/step_file_injection.py diff --git a/.gitignore b/.gitignore index c97af67db..b901fb97f 100644 --- a/.gitignore +++ b/.gitignore @@ -105,37 +105,47 @@ site/ # python notebook *.ipynb -!docs/tutorials/fundamentals/1_understanding_gui/tutorial.ipynb # Doc generation mkdocs.yml /taipy /taipy-fe +/taipy-doc-files +/fe_node_modules/ + +#/docs/contributing/code_of_conduct.md +#/docs/contributing/contributors.md +#/docs/contributing/index.md + +/docs/gallery/index.md +/docs/gallery/finance/index.md +/docs/gallery/decision_support/index.md +/docs/gallery/llm/index.md +/docs/gallery/visualization/index.md +/docs/gallery/other/index.md + /docs/refmans/gui/viselements/index.md /docs/refmans/gui/viselements/generic/*.md !/docs/refmans/gui/viselements/generic/index.md /docs/refmans/gui/viselements/generic/charts/*.md /docs/refmans/gui/viselements/corelements/*.md -!/docs/userman/gui/gui_example.ipynb -/docs/xrefs /docs/refmans/reference/**/*.md !/docs/refmans/reference/index.md /docs/refmans/reference_rest/*.md !/docs/refmans/reference_rest/index.md /docs/refmans/reference_guiext/ -/docs/contributing/contributors.md -/fe_node_modules/ + /docs/tutorials/index.md /docs/tutorials/getting_started/index.md +#/docs/tutorials/getting_started/installation.md /docs/tutorials/scenario_management/index.md /docs/tutorials/visuals/index.md /docs/tutorials/integration/index.md /docs/tutorials/large_data/index.md /docs/tutorials/fundamentals/index.md -/docs/gallery/index.md -/docs/gallery/finance/index.md -/docs/gallery/decision_support/index.md -/docs/gallery/llm/index.md -/docs/gallery/visualization/index.md -/docs/gallery/other/index.md +!docs/tutorials/fundamentals/1_understanding_gui/tutorial.ipynb + /docs/userman/ecosystem/designer +!/docs/userman/gui/gui_example.ipynb + +/docs/xrefs diff --git a/docs/contributing/code_of_conduct.md b/docs/contributing/code_of_conduct.md deleted file mode 100644 index 6cee35cf7..000000000 --- a/docs/contributing/code_of_conduct.md +++ /dev/null @@ -1,126 +0,0 @@ -# Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -# Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people. -* Being respectful of differing opinions, viewpoints, and experiences. -* Giving and gracefully accepting constructive feedback. -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience. -* Focusing on what is best not just for us as individuals, but for the - overall community. - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind. -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment. -* Publishing others' private information, such as a physical or email - address, without their explicit permission. -* Other conduct which could reasonably be considered inappropriate in a - professional setting. - -# Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -# Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -# Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -rnd@avaiga.com. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -# Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -## 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -## 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -## 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -## 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -# Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/docs/contributing/code_of_conduct.md_template b/docs/contributing/code_of_conduct.md_template new file mode 100644 index 000000000..94de3ed81 --- /dev/null +++ b/docs/contributing/code_of_conduct.md_template @@ -0,0 +1,5 @@ +--- +title: Contributor Covenant Code of Conduct +--- + +[CODE_OF_CONDUCT] diff --git a/docs/contributing/index.md b/docs/contributing/index.md deleted file mode 100644 index 66672154e..000000000 --- a/docs/contributing/index.md +++ /dev/null @@ -1,150 +0,0 @@ ---- -title : Contributing to Taipy ---- - -Thanks for your interest in helping improve Taipy! Contributions are welcome, and they are -greatly appreciated! Every little help and credit will always be given. - -There are multiple ways to contribute to Taipy, code, but also reporting bugs, creating feature -requests, helping other users in our forums, Stack Overflow, etc. - -Several channels are open to communicate with the Taipy team: - -- The [taipy.io forum](https://www.taipy.io/community/) for open discussion with the Taipy team. -- [GitHub issues](https://github.com/Avaiga/taipy/issues) on the - [`taipy` repository](https://github.com/Avaiga/taipy) to suggest improvements, new features, - or to report a bug. -- [GitHub discussions](https://github.com/Avaiga/taipy/discussions) on the - [`taipy` repository](https://github.com/Avaiga/taipy) for discussing technical topics - related to the implementation of Taipy. -- [StackOverflow](https://stackoverflow.com/questions/tagged/taipy) for precise questions - related to the usage of Taipy. - -Before contributing to Taipy, please read our [Code of conduct](code_of_conduct.md). - -# Never contributed to an open source project before ? - -Have a look at this -[GitHub documentation](https://docs.github.com/en/get-started/quickstart/contributing-to-projects). - -# Bugs report - -Reporting bugs is through [GitHub issues](https://github.com/Avaiga/taipy/issues). - -Please report relevant information and preferably code that exhibits the problem. We provide -templates to help you present the issue in a comprehensive way. - -The Taipy team will analyze and try to reproduce the bug to provide feedback. If confirmed, we -will add a priority to the issue and add it in our backlog. Feel free to propose a pull request -to fix it. - -# Feedback and proposals - -Any feedback or proposal is greatly appreciated! Do not hesitate to create an issue with the -appropriate template on [GitHub](https://github.com/Avaiga/taipy/issues). - -The Taipy team will analyze your issue and return to you as soon as possible. - -# Improve Documentation - -Do not hesitate to create an issue or pull request directly on the -[taipy-doc repository](https://github.com/Avaiga/taipy-doc/issues). - -# Code organization - -The Taipy source code is located in the [taipy](https://github.com/Avaiga/taipy) -repository, in the `taipy` directory. - -Packages sources are organized in subdirectories from there: - -- `taipy-config` -- `taipy-core` -- `taipy-gui` -- `taipy-rest` -- `taipy-templates` - -# Best practices - -## Python - -Taipy's repositories follow the [PEP 8](https://www.python.org/dev/peps/pep-0008/) and -[PEP 484](https://www.python.org/dev/peps/pep-0484/) coding convention. - -## JavaScript - -Taipy's repositories follow the [W3Schools](https://www.w3schools.com/js/js_conventions.asp) and -[Google](https://google.github.io/styleguide/tsguide.html) coding convention. - -## Git branches - -All new development happens in the `develop` branch. All pull requests should target that branch. -We are following a strict branch naming convention based on the pattern: -`/#[]`. - -Where: - -- `` would be one of: - - feature: new feature implementation, or improvement of a feature. - - fix: bug fix. - - review: change provoked by review comment not immediately taken care of. - - refactor: refactor of a piece of code. - - doc: doc changes (complement or typo fixes…). - - build: in relation with the build process. -- `` is the processed issue identifier. The advantage of explicitly indicating the - issue number is that in GitHub, a pull request page shows a direct link to the issue - description. -- `[]` is a short summary of the issue topic, not including spaces, using Camel - case or lower-case, dash-separated words. This summary, with its dash (‘-’) symbol prefix, - is optional. - -# Contribution workflow - -Review and pick an issue you want to work on among the issues with the label -`Good first issue` or `Help wanted`. Add a comment on it to inform the community -that you want to work on it, and to ask the Taipy maintainers to assign it to you. - -1. Make your [own fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) - of the repository target by the issue. Clone it on our local machine, then go inside the - directory. - -2. We are working with [Pipenv](https://github.com/pypa/pipenv) for our virtual environments. - Create a local env and install development package by running `pipenv install --dev`, then - run tests with `pipenv run pytest` to verify your setup. - -3. For convention help, we provide a [pre-commit](https://pre-commit.com/hooks.html) file. - This tool will run before each commit and will automatically reformat code or raise warnings - and errors based on the code format or Python typing. You can install and setup it up by doing: - ```console - pipenv install pre-commit --skip-lock - pipenv run python -m pre-commit install - ``` - -4. Make the change and create a - [pull request from your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork). - Keep your pull request in __draft__ until your work is finished. - Do not hesitate to add a comment for help or questions. - - Before you submit a pull request read to review from your forked repo, check that it meets - these guidelines: - - Include tests. - - Code is [rebase](http://stackoverflow.com/a/7244456/1110993). - - License is present. - - pre-commit works - without MyPI errors. - - GitHub's actions are passing. - -5. The Taipy team will have a look at your Pull Request and will give feedback. If every - requirement is valid, your work will be added in the next release, congratulation! - -# Dependency management - -Taipy comes with multiple optional packages. You can find the list directly in the product or -Taipy's packages. The back-end Pipfile does not install by default optional packages due to -`pyodbc` requiring a driver's manual installation. This is not the behavior for the front-end -that installs all optional packages through its Pipfile. - -If you are a contributor on Taipy, be careful with dependencies, do not forget to install or -uninstall depending on your issue. - -If you need to add to Taipy a new dependency, do not forget to add it in the `Pipfile` and -`setup.py`. Keep in mind that dependency is a vector of attack. The Taipy team limits the usage -of external dependencies at the minimum. diff --git a/docs/contributing/index.md_template b/docs/contributing/index.md_template new file mode 100644 index 000000000..7cfc33e0c --- /dev/null +++ b/docs/contributing/index.md_template @@ -0,0 +1,5 @@ +--- +title : Contributing to Taipy +--- + +[CONTRIBUTING] diff --git a/docs/tutorials/getting_started/installation.md b/docs/tutorials/getting_started/installation.md deleted file mode 100644 index 55412c8c6..000000000 --- a/docs/tutorials/getting_started/installation.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Install Taipy ---- - -Welcome to the installation section of the Taipy web application builder! This section will -guide you through the seamless and straightforward process of setting up and deploying your own -powerful web applications. - -# Prerequisite - -Before installing Taipy, ensure you have Python (**version 3.9 or later**) and -[pip](https://pip.pypa.io) installed on your system. If you don't have pip installed, you can -follow these steps to install it: - -1. **[Python Installation Guide](http://docs.python-guide.org/en/latest/starting/installation/)**: - Follow the installation guide to set up Python on your system. - After the installation, you can open the Command Prompt and type `python --version` to check - the installed Python version. - -2. **[Installing pip](https://pip.pypa.io/en/latest/installation/)**: Pip is included by default - if you use Python 3.4 or later. Otherwise, you can follow the official - installation page of pip to install it. To verify the installation, type `pip --version` or - `pip3 --version`. - -Alternatively, if you are using a Conda environment, you can install pip using the following -command: - -```console -$ conda install pip -``` - -To install Taipy, you have several options depending on your needs and preferences. - -# Installing Taipy - Stable release - -The preferred method to install Taipy is by using **pip**. Open your terminal or command prompt -and run the following command: - -```console -$ pip install taipy -``` - -This command will download and install the most recent stable release of Taipy. - - -# Installing Taipy with Colab - -Google Colab is a popular and free Jupyter notebook environment that requires no setup -and runs entirely in the cloud. To install Taipy in Google Colab, follow these simple -steps: - -1. **Open a new Colab notebook**: Visit [Google Colab](https://colab.research.google.com) -and start a new notebook. - -2. **Run the installation command**: In a new cell, enter the following command and run -the cell: - - ```python - !pip install --ignore-installed taipy - ``` - - This command installs the latest stable release of Taipy in your Colab environment. - -3. **Start building your app**: Follow this -[tip](../articles/colab_with_ngrok/index.md) to build and run your Taipy web -application directly within the Colab notebook. - -!!! tip - Remember that Google Colab environments are ephemeral. If you disconnect or restart - your Colab session, you will need to reinstall Taipy. - -# Installing Taipy in a Conda Environment - -Conda is an open-source package management system and environment management system that runs on -Windows, macOS, and Linux. - -If you prefer to work within a [Conda](https://docs.conda.io/projects/conda/en/latest/index.html) -environment, follow these steps: - -1. Create a new **Conda** environment (replace **env-name** with your desired environment name): - ```console - $ conda create -n env-name - ``` -2. Activate the newly created environment: - ``` console - $ conda activate env-name - ``` -3. Install Taipy within the Conda environment using pip: - ```console - $ pip install taipy - ``` - -# Installing Taipy from Source - -If you want to work with the latest development version or contribute to the project, you can -install Taipy from the source code. - -- Clone the public repository from GitHub (you'll need Git installed for this method): - ```console - $ git clone git://github.com/avaiga/taipy - ``` - -Or, - -- Download the tarball directly from GitHub: - ```console - $ curl -OJL https://github.com/avaiga/taipy/tarball/main - ``` - -Once you have the source code, navigate to the directory containing the Taipy source code and -run the following command: - -```console -$ pip install . -``` - -This will install Taipy from the source code on your system. - -!!! info - The commands mentioned above are for Unix-like systems (Linux, macOS), and you may - need to adjust them slightly if you are using a different operating system such as Windows. diff --git a/docs/tutorials/getting_started/installation.md_template b/docs/tutorials/getting_started/installation.md_template new file mode 100644 index 000000000..74e6444ec --- /dev/null +++ b/docs/tutorials/getting_started/installation.md_template @@ -0,0 +1,5 @@ +--- +title: Install Taipy +--- + +[INSTALLATION] diff --git a/tools/_setup_generation/setup.py b/tools/_setup_generation/setup.py index 004f5e273..4ecd938f2 100644 --- a/tools/_setup_generation/setup.py +++ b/tools/_setup_generation/setup.py @@ -1,3 +1,4 @@ +import os from abc import ABC, abstractmethod from datetime import datetime import re @@ -131,6 +132,7 @@ def run_setup(root_dir: str, steps: List[SetupStep] = None): from .step_rest_refman import RestRefManStep from .step_gui_ext_refman import GuiExtRefManStep from .step_contributors import ContributorsStep + from .step_file_injection import FileInjectionStep from .step_designer import DesignerStep steps = [ @@ -141,6 +143,21 @@ def run_setup(root_dir: str, steps: List[SetupStep] = None): RestRefManStep(), GuiExtRefManStep(), ContributorsStep(), + FileInjectionStep("installation", + "Generating the installation page.", + "[INSTALLATION]", + os.path.join("taipy-doc-files", "INSTALLATION.md"), + os.path.join("tutorials", "getting_started", "installation.md")), + FileInjectionStep("code_of_conduct", + "Generating the code of conduct page.", + "[CODE_OF_CONDUCT]", + os.path.join("taipy-doc-files", "CODE_OF_CONDUCT.md"), + os.path.join("contributing", "code_of_conduct.md")), + FileInjectionStep("contributing", + "Generating the contributing page.", + "[CONTRIBUTING]", + os.path.join("taipy-doc-files", "CONTRIBUTING.md"), + os.path.join("contributing", "index.md")), DesignerStep(), ] setup = Setup(root_dir, steps) diff --git a/tools/_setup_generation/step_contributors.py b/tools/_setup_generation/step_contributors.py index 085bd8ab4..c8c3b9997 100644 --- a/tools/_setup_generation/step_contributors.py +++ b/tools/_setup_generation/step_contributors.py @@ -20,10 +20,11 @@ def __init__(self): self.ORGANIZATION_URL = f"{self.BASE_URL}/orgs/Avaiga" self.MEMBERS_URL = f"{self.ORGANIZATION_URL}/members" self.REPOS = f"{self.ORGANIZATION_URL}/repos" + self.CONTRIBUTORS_URL = f"{self.BASE_URL}/Avaiga/taipy/contributors" self.REPO_URLS = [] self.MEMBERS = {} self.CONTRIBUTORS = {} - self.ANONYMOUS = ["dependabot[bot]"] + self.ANONYMOUS = ["dependabot[bot]", "infrastructure-management[bot]"] self.PATH = "" self.TEMPLATE_SUFFIX = "_template" @@ -66,32 +67,15 @@ def get_avaiga_members(self): def get_contributors(self): for url in self.REPO_URLS: - response = self.__get(url + "/contents/contributors.txt") - public_contributor_logins = [] - if response.status_code == 200: - data = response.json() - content = data["content"] - encoding = data["encoding"] - if encoding == 'base64': - file_content = base64.b64decode(content).decode() - public_contributor_logins += file_content.strip().split("\n") - else: - print(f"WARNING - Couldn't get contributors from {url}. unknown encoding: {encoding}", flush=True) - continue - elif response.status_code == 404: - print(f"INFO - No contributors.txt in repository {url[len(self.BASE_URL)+14:]}.", flush=True) - else: - print(f"WARNING - Couldn't get contributors for {url}. response.status_code: {response.status_code}", - flush=True) - continue - response = self.__get(url+"/contributors") + response = self.__get(url + "/contributors") if response.status_code != 200: - print(f"WARNING - Couldn't get contributors. response.status_code: {response.status_code}", flush=True) - continue - for c in response.json(): - login = c['login'] - if login not in self.MEMBERS and login not in self.ANONYMOUS and login in public_contributor_logins: - self.CONTRIBUTORS[login] = {"avatar_url": c['avatar_url'], "html_url": c['html_url']} + print(f"WARNING - Couldn't get collaborators. response.status_code: {response.status_code}", flush=True) + return + contributors = response.json() + for contrib in contributors: + login = contrib['login'] + if login not in self.CONTRIBUTORS and login not in self.ANONYMOUS: + self.CONTRIBUTORS[login] = {"avatar_url": contrib['avatar_url'], "html_url": contrib['html_url']} def build_content(self, *members_pattern_tuples): pattern_content_tuples = [] diff --git a/tools/_setup_generation/step_file_injection.py b/tools/_setup_generation/step_file_injection.py new file mode 100644 index 000000000..0d7f26d37 --- /dev/null +++ b/tools/_setup_generation/step_file_injection.py @@ -0,0 +1,56 @@ +# ################################################################################ +# Taipy installation page generation setup step. +# +# ################################################################################ +import os + +from .setup import SetupStep, Setup + + +class FileInjectionStep(SetupStep): + + def __init__(self, id, desc, pattern, src_relative_path, dest_relative_path): + self.id = id + self.desc = desc + self.src_relative_path = src_relative_path + self.dest_relative_path = dest_relative_path + + self.pattern = pattern + self.src_path = None + self.dst_path = None + self.dst_tpl_path = None + + def enter(self, setup: Setup): + self.src_path = os.path.join(setup.root_dir, self.src_relative_path) + self.dst_path = os.path.join(setup.docs_dir, self.dest_relative_path) + self.dst_tpl_path = os.path.join(setup.docs_dir, str(self.dest_relative_path) + "_template") + + def get_id(self) -> str: + return self.id + + def get_description(self) -> str: + return self.desc + + def setup(self, setup: Setup) -> None: + try: + with open(self.src_path, 'r') as file: + content = file.read() + self._replace(self.dst_tpl_path, self.pattern, content, self.dst_path) + except Exception as e: + print(f"Error: cannot generate page: {e}") + + @staticmethod + def _replace(in_tpl_file_path, pattern, by, into_file_path): + # Read template file + with open(in_tpl_file_path, 'r') as tpl_file: + from_file_content = tpl_file.read() + + # Replace the pattern by the contents + content = from_file_content.replace(pattern, by) + + # Write the file to_file + with open(into_file_path, 'w') as into_file: + into_file.write(content) + + def exit(self, setup: Setup): + pass diff --git a/tools/fetch_source_files.py b/tools/fetch_source_files.py index a2d9f8e49..5e20a5ccc 100644 --- a/tools/fetch_source_files.py +++ b/tools/fetch_source_files.py @@ -191,7 +191,7 @@ def safe_rmtree(dir: str): pipfile_packages = {} PIPFILE_PACKAGE_RE = re.compile(r"(..*?)\s?=\s?(.*)") -frontend_dir = os.path.join(ROOT_DIR, "taipy-fe") +# frontend_dir = os.path.join(ROOT_DIR, "taipy-fe") # Fetch files @@ -327,22 +327,24 @@ def copy(item: str, src: str, dst: str, rel_path: str): copy_source(src_path, repo) - # Copy Taipy GUI front end code if repo == "taipy": + # Copy Taipy GUI front end code if not os.path.isdir(frontend_dir): os.mkdir(frontend_dir) fe_src_dir = os.path.join(src_path, "frontend", "taipy-gui") - shutil.copytree( - os.path.join(fe_src_dir, "src"), os.path.join(frontend_dir, "src") - ) - for f in [ - f - for f in os.listdir(fe_src_dir) - if f.endswith(".md") or f.endswith(".json") - ]: - shutil.copy( - os.path.join(fe_src_dir, f), os.path.join(frontend_dir, f) - ) + shutil.copytree(os.path.join(fe_src_dir, "src"), os.path.join(frontend_dir, "src")) + for f in [f for f in os.listdir(fe_src_dir) if f.endswith(".md") or f.endswith(".json")]: + shutil.copy(os.path.join(fe_src_dir, f), os.path.join(frontend_dir, f)) + + # Copy INSTALLATION.md, CONTRIBUTING.md, and CODE_OF_CONDUCT.md + if not os.path.isdir(taipy_documentation_files_dir): + os.mkdir(taipy_documentation_files_dir) + shutil.copy(os.path.join(src_path, "INSTALLATION.md"), + os.path.join(taipy_documentation_files_dir, "INSTALLATION.md")) + shutil.copy(os.path.join(src_path, "CONTRIBUTING.md"), + os.path.join(taipy_documentation_files_dir, "CONTRIBUTING.md")) + shutil.copy(os.path.join(src_path, "CODE_OF_CONDUCT.md"), + os.path.join(taipy_documentation_files_dir, "CODE_OF_CONDUCT.md")) finally: pass """ @@ -359,6 +361,10 @@ def copy(item: str, src: str, dst: str, rel_path: str): if os.path.isdir(os.path.join(frontend_dir)): shutil.rmtree(frontend_dir) +taipy_documentation_files_dir = os.path.join(ROOT_DIR, "taipy-doc-files") +if os.path.exists(taipy_documentation_files_dir): + shutil.rmtree(taipy_documentation_files_dir) + for repo in repo_defs.keys(): if repo_defs[repo].get("skip", False): continue