|
| 1 | +# trame-common: common code for any trame package |
| 2 | + |
| 3 | +Trame is rapidly evolving and having a dependency-less package to provide helper |
| 4 | +functions and classes across trame's eco-system is important for its future |
| 5 | +health. Initially some of those classes were created inside **trame-client**, |
| 6 | +**trame-server** or even **trame**, but we reached a point where some of those |
| 7 | +should become even more mainstream so they could easily be used on server, |
| 8 | +client, widget and more. That is where **trame-common** comes to play by |
| 9 | +providing a central location that any package can depend on. By default, |
| 10 | +**trame** remain the meta package that will impose some minimum version on |
| 11 | +**trame-common**, **trame-client** and **trame-server** and expose via some |
| 12 | +common namespace various pieces of those 3 dependencies. But if you need any |
| 13 | +piece of **trame-common**, feel free to depend on it. |
| 14 | + |
| 15 | +Trame-common is not meant to be installed by itself, but instead be used by any |
| 16 | +trame package that may require one of its function or helper class. While some |
| 17 | +of the module may require extra dependency, we are not listing them in this |
| 18 | +package purposely but the using code, should properly describe such dependency. |
| 19 | + |
| 20 | +## Content |
| 21 | + |
| 22 | +**trame-common** is composed of several packages to split the current set of |
| 23 | +classes and function in meaningful groups. |
| 24 | + |
| 25 | +- **trame_common.assets**: Contains anything related to local and remote file |
| 26 | + including possible associated mime types. |
| 27 | +- **trame_common.decorators**: Contains all decorators for functions, classes |
| 28 | + and methods. |
| 29 | +- **trame_common.exec**: Contains helpers for handling code execution (i.e. |
| 30 | + async, throttle, debounce, thread, process). |
| 31 | +- **trame_common.obj**: Contains helpers for common trame objects (i.e. |
| 32 | + Component, App, Widget, Singleton) |
| 33 | + |
| 34 | +## License |
| 35 | + |
| 36 | +trame-common is made available under the Apache License, Version 2.0. For more |
| 37 | +details, see |
| 38 | +[LICENSE](https://github.com/Kitware/trame-common/blob/master/LICENSE). |
| 39 | + |
| 40 | +## Development steps |
| 41 | + |
| 42 | +- Clone the repository using `git clone` |
| 43 | +- Install pre-commit via `pip install pre-commit` or `pip install -e ".[dev]"` |
| 44 | +- Run `pre-commit install` to set up pre-commit hooks |
| 45 | +- Run `pre-commit install --hook-type commit-msg` to register commit-msg hook |
| 46 | +- Make changes to the code, and commit your changes to a separate branch. Use |
| 47 | + [conventional commit messages](https://www.conventionalcommits.org/en/v1.0.0/). |
| 48 | +- Create a fork of the repository on GitHub |
| 49 | +- Push your branch to your fork, and open a pull request |
| 50 | + |
| 51 | +**Tips** |
| 52 | + |
| 53 | +- When first creating a new project, it is helpful to run |
| 54 | + `pre-commit run --all-files` to ensure all files pass the pre-commit checks. |
| 55 | +- A quick way to fix `ruff` issues is by installing ruff (`pip install ruff`) |
| 56 | + and running the `ruff check --fix .` or `ruff format` command at the root of |
| 57 | + your repository. |
| 58 | +- A quick way to fix `codespell` issues is by installing codespell |
| 59 | + (`pip install codespell`) and running the `codespell -w` command at the root |
| 60 | + of your directory. |
| 61 | +- The |
| 62 | + `.codespellrc file <https://github.com/codespell-project/codespell#using-a-config-file>`\_ |
| 63 | + can be used fix any other codespell issues, such as ignoring certain files, |
| 64 | + directories, words, or regular expressions. |
0 commit comments