diff --git a/contrib/LICENSE b/contrib/LICENSE index 60a996edb..261eeb9e9 100644 --- a/contrib/LICENSE +++ b/contrib/LICENSE @@ -199,30 +199,3 @@ 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. - -------------------------------- - -hamilton/experimental/databackend.py is copied from https://github.com/machow/databackend -and is licensed under the MIT License. - -MIT License - -Copyright (c) 2024 databackend contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/contrib/README.md b/contrib/README.md index f481388df..fe6d0240e 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -209,3 +209,20 @@ If the above apply, run the `init-dataflow` command with `-s` to specify a sanit ## Got questions? Join our [slack](https://join.slack.com/t/hamilton-opensource/shared_invite/zt-2niepkra8-DGKGf_tTYhXuJWBTXtIs4g) community to chat/ask Qs/etc. + +## Building from source + +This package uses [flit](https://flit.pypa.io/) as its build backend (declared +in `pyproject.toml`). To build the source distribution and wheel from a source +checkout: + +```bash +# from the contrib directory (the package root) +python -m pip install flit +flit build --no-use-vcs +# artifacts are written to dist/ +``` + +`flit build` produces both the `.tar.gz` source distribution and the +`.whl` wheel. `--no-use-vcs` selects files from the working tree rather than +git, which is what you want when building from an unpacked source release. diff --git a/dev_tools/language_server/LICENSE b/dev_tools/language_server/LICENSE index 69f3792df..7c12ac2bb 100644 --- a/dev_tools/language_server/LICENSE +++ b/dev_tools/language_server/LICENSE @@ -202,33 +202,8 @@ ------------------------------- -hamilton/experimental/databackend.py is copied from https://github.com/machow/databackend -and is licensed under the MIT License. - -MIT License - -Copyright (c) 2024 databackend contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - This product includes test code derived from pygls (https://github.com/openlawlibrary/pygls): Copyright (c) Open Law Library. All rights reserved. Licensed under the Apache License, Version 2.0. -See dev_tools/language_server/tests/ls_setup.py. +See tests/ls_setup.py. diff --git a/dev_tools/language_server/README.md b/dev_tools/language_server/README.md index 8c3184767..b4c1c56a6 100644 --- a/dev_tools/language_server/README.md +++ b/dev_tools/language_server/README.md @@ -30,3 +30,24 @@ under the License. This is an implementation of the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) to provide a rich IDE experience when creating Apache Hamilton dataflows. It currently powers the Apache Hamilton VSCode extension and could be integrated into other IDEs. + +# Building from source + +This package uses [flit](https://flit.pypa.io/) as its build backend (declared +in `pyproject.toml`). To build the source distribution and wheel from a source +checkout: + +```bash +# from the dev_tools/language_server directory (the package root) +python -m pip install flit +flit build --no-use-vcs +# artifacts are written to dist/ +``` + +`flit build` produces both the `.tar.gz` source distribution and the +`.whl` wheel. `--no-use-vcs` selects files from the working tree rather than +git, which is what you want when building from an unpacked source release. + +# License + +The code here is licensed under the Apache 2.0 license. See the main repository [LICENSE](../../LICENSE) for details. diff --git a/scripts/apache_release_helper.py b/scripts/apache_release_helper.py index 84bb3ca8a..723526039 100644 --- a/scripts/apache_release_helper.py +++ b/scripts/apache_release_helper.py @@ -367,6 +367,13 @@ def create_release_artifacts(package_config: dict, version, no_sign: bool = Fals ["npm", "run", "build", "--prefix", frontend_dir], check=True, ) + # Generate third-party license attributions for the bundled + # frontend dependencies (required since the wheel ships + # compiled JS/CSS). Writes build/THIRD-PARTY-LICENSES.txt. + subprocess.run( + ["npm", "run", "licenses", "--prefix", frontend_dir], + check=True, + ) # Copy built assets to hamilton_ui/build/ if os.path.exists(build_target): shutil.rmtree(build_target) diff --git a/ui/backend/LICENSE b/ui/backend/LICENSE index 60a996edb..9f830c4e3 100644 --- a/ui/backend/LICENSE +++ b/ui/backend/LICENSE @@ -202,27 +202,16 @@ ------------------------------- -hamilton/experimental/databackend.py is copied from https://github.com/machow/databackend -and is licensed under the MIT License. - -MIT License - -Copyright (c) 2024 databackend contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +This package is distributed in two forms: + + * The source distribution (sdist) contains only Apache Hamilton source + code and is licensed under the Apache License, Version 2.0 above. + + * The binary distribution (wheel) additionally bundles a compiled + frontend web application (hamilton_ui/build/) built from the + TypeScript/React sources in ui/frontend/. That bundle includes + third-party JavaScript dependencies (e.g. React, Redux, Chart.js, + React Flow), each under permissive licenses (MIT, Apache-2.0, BSD, + ISC, and similar). The full per-dependency license texts and + copyright notices are included in the wheel at + hamilton_ui/build/THIRD-PARTY-LICENSES.txt. diff --git a/ui/backend/README.md b/ui/backend/README.md index 7d5330b29..ac046d275 100644 --- a/ui/backend/README.md +++ b/ui/backend/README.md @@ -80,6 +80,44 @@ dr = ( ) ``` +## Building from source + +This package uses [flit](https://flit.pypa.io/) as its build backend (declared +in `pyproject.toml`). + +The **source distribution** (`.tar.gz`) is backend-only and builds directly: + +```bash +# from the ui/backend directory (the package root) +python -m pip install flit +flit build --no-use-vcs --format sdist +# artifact is written to dist/ +``` + +The **wheel** additionally bundles a compiled frontend, so it requires +Node.js + npm. Build the frontend first, copy it into the package, then +build the wheel: + +```bash +# 1. build the frontend (from ui/frontend) +cd ../frontend +npm install +npm run build +npm run licenses # generates build/THIRD-PARTY-LICENSES.txt + +# 2. copy the compiled assets into the backend package +rm -rf ../backend/hamilton_ui/build +cp -r build ../backend/hamilton_ui/build + +# 3. build the wheel (from ui/backend) +cd ../backend +flit build --no-use-vcs --format wheel +# artifact is written to dist/ +``` + +The release script `scripts/apache_release_helper.py --package ui` performs all +of these steps automatically. + ## License Apache 2.0. See the main repository [LICENSE](../../LICENSE) for details. diff --git a/ui/frontend/package.json b/ui/frontend/package.json index 44ec32aea..199f56858 100644 --- a/ui/frontend/package.json +++ b/ui/frontend/package.json @@ -58,6 +58,7 @@ "start": "vite", "build": "vite build", "build:check": "tsc && vite build", + "licenses": "npx --yes license-checker-rseidelsohn --production --plainVertical --excludePackages \"frontend@0.1.0\" --out build/THIRD-PARTY-LICENSES.txt", "preview": "vite preview", "lint": "eslint . --ext .js,.ts,.jsx,.tsx", "lint-fix": "eslint . --ext .js,.ts,.jsx,.tsx --fix", @@ -95,6 +96,7 @@ "eslint-plugin-react-refresh": "^0.4.16", "globals": "^15.13.0", "husky": "^9.1.7", + "license-checker-rseidelsohn": "^5.0.1", "lint-staged": "^15.2.11", "postcss": "^8.5.14", "prettier": "^3.4.2", diff --git a/ui/sdk/LICENSE b/ui/sdk/LICENSE index 60a996edb..261eeb9e9 100644 --- a/ui/sdk/LICENSE +++ b/ui/sdk/LICENSE @@ -199,30 +199,3 @@ 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. - -------------------------------- - -hamilton/experimental/databackend.py is copied from https://github.com/machow/databackend -and is licensed under the MIT License. - -MIT License - -Copyright (c) 2024 databackend contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/ui/sdk/README.md b/ui/sdk/README.md index 6cc9591ea..746a9a304 100644 --- a/ui/sdk/README.md +++ b/ui/sdk/README.md @@ -88,5 +88,22 @@ Then run Apache Hamilton as normal! Each DAG run will be tracked, and you'll hav Apache Hamilton UI. After spinning up the Apache Hamilton UI application, visit it to see your projects & DAGs. +# Building from source + +This package uses [flit](https://flit.pypa.io/) as its build backend (declared +in `pyproject.toml`). To build the source distribution and wheel from a source +checkout: + +```bash +# from the ui/sdk directory (the package root) +python -m pip install flit +flit build --no-use-vcs +# artifacts are written to dist/ +``` + +`flit build` produces both the `.tar.gz` source distribution and the +`.whl` wheel. `--no-use-vcs` selects files from the working tree rather than +git, which is what you want when building from an unpacked source release. + # License The code here is licensed under the Apache 2.0 license. See the main repository [LICENSE](../../LICENSE) for details.