# cookiecutter-server
[![build](https://img.shields.io/github/actions/workflow/status/at-gmbh/cookiecutter-server/build.yml?branch=master)](https://github.com/at-gmbh/at-python-template/actions?query=branch%3Amaster+)
[![PyPI](https://img.shields.io/pypi/v/cookiecutter-server)](https://pypi.org/project/cookiecutter-server/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cookiecutter-server)](https://pypi.org/project/cookiecutter-server/)
[![PyPI - License](https://img.shields.io/pypi/l/personio-py)](https://github.com/at-gmbh/cookiecutter-server/blob/master/LICENSE)
A local development server to get live previews of [cookiecutter templates](https://github.com/cookiecutter/cookiecutter).
Are there too many code paths in your cookiecutter templates? You need an easy way to check what your template looks like with different parameters? cookiecutter-server got you covered! It's a process that watches the source folder of your template and serves the rendered template in a different folder. Whenever you make a change in your template or select different parameters, the rendered template gets updated automatically.
## Getting Started
Install cookiecutter-server with
pip install cookiecutter-server
This will make the `cc_server` command available on your terminal. Test it with
cc_server --help
In case the command was not registered, you can use `python -m cc_server` instead.
Now switch to your cookiecutter template folder and run
cc_server .
This will launch cookiecutter-server in the current folder and render the template in a new folder named `serve` under the current folder. Of course, you can also provide custom paths, if you prefer:
cc_server path/to/cookiecutter -o path/to/output
The server process will now watch your template folder for changes. Please make a change in one of your template files and save the file. On the terminal, cc_server will tell you
> updating due to change in {changed file}
Now open this file in the output folder; your changes have already been applied. If you don't see the changes, please re-open the file or use an editor that automatically updates files when they change on disk, like PyCharm or VSCode.
How do you change your template parameters? In your cookiecutter template folder, a new file named `cookiecutter-server.yml` was created, which contains all the parameters of your template. Change the parameters to your liking and save the file, cookiecutter-server will immediately update the contents of the output folder.
To stop the server, use Ctrl+C on your terminal.
If you're having trouble with cookiecutter-server, please have a look at the [open issues](https://github.com/at-gmbh/cookiecutter-server/issues) and open a new one, if you can't find a solution.
## Contributing
To set up your local development environment, please use a fresh virtual environment, then run:
pip install -r requirements.txt -r requirements-dev.txt
pip install -e .
You can now launch the server from the command line; try `cc_server --help`.
We use `pytest` as test framework. To execute the tests, please run
python setup.py test
To build a distribution package (wheel), please use
python setup.py dist
this will clean up the build folder and then run the `bdist_wheel` command.
Before contributing code, please set up the pre-commit hooks to reduce errors and ensure consistency
pip install -U pre-commit
pre-commit install
### PyPI Release
This project is released on [PyPI](https://pypi.org/project/cookiecutter-server/). Most of the tedious steps that are required to test & publish your release are automated by [CI pipelines](https://github.com/at-gmbh/cookiecutter-server/actions). All you have to do is to write your code and when the time comes to make a release, please follow these steps:
* update the program version in [`src/cc_server/version.py`](./src/cc_server/version.py)
* write a summary of your changes in [`CHANGELOG.md`](./CHANGELOG.md)
* add a tag on the master branch with the new version number preceded by the letter `v`, e.g. for version 1.0.0 the tag would be `v1.0.0`. To tag the head of the current branch, use `git tag v1.0.0`
* push your changes to GitHub and don't forget to push the tag with `git push origin v1.0.0`
* now have a look at the [release pipeline](https://github.com/at-gmbh/cookiecutter-server/actions/workflows/release.yml); if it finishes without errors, you can find your release on [TestPyPI](https://test.pypi.org/project/cookiecutter-server/). Please verify that your release works as expected.
* Now for the live deployment on PyPI. To avoid mistakes, this is only triggered, when a release is published on GitHub first. Please have a look at the [Releases](https://github.com/at-gmbh/cookiecutter-server/releases) now; there should be a draft release with your version number (this was created by the CI pipeline which also made the TestPyPI release). Edit the draft release, copy the text you added to [`CHANGELOG.md`](./CHANGELOG.md) into the description field and publish it.
* After you publish the release, the [deploy pipeline](https://github.com/at-gmbh/cookiecutter-server/actions/workflows/deploy.yml) is triggered on GitHub. It will publish the release directly to [PyPI](https://pypi.org/project/cookiecutter-server/) where everyone can enjoy your latest features.
## Contact
Sebastian Straub (sebastian.straub [at] alexanderthamm.com)
Developed with ❤ at [Alexander Thamm GmbH](https://www.alexanderthamm.com/)
## License
Copyright 2021 Alexander Thamm GmbH
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/at-gmbh/cookiecutter-server",
"name": "cookiecutter-server",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Sebastian Straub",
"author_email": "sebastian.straub@alexanderthamm.com",
"download_url": "https://files.pythonhosted.org/packages/e6/0e/917b6aaf4eb9d3c3338dac7532ed2e93b24fbe2f61eff9dcb004e9f8cc10/cookiecutter-server-1.1.0.tar.gz",
"platform": "any",
"description": "# cookiecutter-server\n\n[![build](https://img.shields.io/github/actions/workflow/status/at-gmbh/cookiecutter-server/build.yml?branch=master)](https://github.com/at-gmbh/at-python-template/actions?query=branch%3Amaster+)\n[![PyPI](https://img.shields.io/pypi/v/cookiecutter-server)](https://pypi.org/project/cookiecutter-server/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cookiecutter-server)](https://pypi.org/project/cookiecutter-server/)\n[![PyPI - License](https://img.shields.io/pypi/l/personio-py)](https://github.com/at-gmbh/cookiecutter-server/blob/master/LICENSE)\n\nA local development server to get live previews of [cookiecutter templates](https://github.com/cookiecutter/cookiecutter).\n\nAre there too many code paths in your cookiecutter templates? You need an easy way to check what your template looks like with different parameters? cookiecutter-server got you covered! It's a process that watches the source folder of your template and serves the rendered template in a different folder. Whenever you make a change in your template or select different parameters, the rendered template gets updated automatically.\n\n## Getting Started\n\nInstall cookiecutter-server with\n\n pip install cookiecutter-server\n\nThis will make the `cc_server` command available on your terminal. Test it with\n\n cc_server --help\n\nIn case the command was not registered, you can use `python -m cc_server` instead.\n\nNow switch to your cookiecutter template folder and run\n\n cc_server .\n\nThis will launch cookiecutter-server in the current folder and render the template in a new folder named `serve` under the current folder. Of course, you can also provide custom paths, if you prefer:\n\n cc_server path/to/cookiecutter -o path/to/output\n\nThe server process will now watch your template folder for changes. Please make a change in one of your template files and save the file. On the terminal, cc_server will tell you\n\n> updating due to change in {changed file}\n\nNow open this file in the output folder; your changes have already been applied. If you don't see the changes, please re-open the file or use an editor that automatically updates files when they change on disk, like PyCharm or VSCode.\n\nHow do you change your template parameters? In your cookiecutter template folder, a new file named `cookiecutter-server.yml` was created, which contains all the parameters of your template. Change the parameters to your liking and save the file, cookiecutter-server will immediately update the contents of the output folder.\n\nTo stop the server, use Ctrl+C on your terminal.\n\nIf you're having trouble with cookiecutter-server, please have a look at the [open issues](https://github.com/at-gmbh/cookiecutter-server/issues) and open a new one, if you can't find a solution.\n\n## Contributing\n\nTo set up your local development environment, please use a fresh virtual environment, then run:\n\n pip install -r requirements.txt -r requirements-dev.txt\n pip install -e .\n\nYou can now launch the server from the command line; try `cc_server --help`.\n\nWe use `pytest` as test framework. To execute the tests, please run\n\n python setup.py test\n\nTo build a distribution package (wheel), please use\n\n python setup.py dist\n\nthis will clean up the build folder and then run the `bdist_wheel` command.\n\nBefore contributing code, please set up the pre-commit hooks to reduce errors and ensure consistency\n\n pip install -U pre-commit\n pre-commit install\n\n### PyPI Release\n\nThis project is released on [PyPI](https://pypi.org/project/cookiecutter-server/). Most of the tedious steps that are required to test & publish your release are automated by [CI pipelines](https://github.com/at-gmbh/cookiecutter-server/actions). All you have to do is to write your code and when the time comes to make a release, please follow these steps:\n\n* update the program version in [`src/cc_server/version.py`](./src/cc_server/version.py)\n* write a summary of your changes in [`CHANGELOG.md`](./CHANGELOG.md)\n* add a tag on the master branch with the new version number preceded by the letter `v`, e.g. for version 1.0.0 the tag would be `v1.0.0`. To tag the head of the current branch, use `git tag v1.0.0`\n* push your changes to GitHub and don't forget to push the tag with `git push origin v1.0.0`\n* now have a look at the [release pipeline](https://github.com/at-gmbh/cookiecutter-server/actions/workflows/release.yml); if it finishes without errors, you can find your release on [TestPyPI](https://test.pypi.org/project/cookiecutter-server/). Please verify that your release works as expected.\n* Now for the live deployment on PyPI. To avoid mistakes, this is only triggered, when a release is published on GitHub first. Please have a look at the [Releases](https://github.com/at-gmbh/cookiecutter-server/releases) now; there should be a draft release with your version number (this was created by the CI pipeline which also made the TestPyPI release). Edit the draft release, copy the text you added to [`CHANGELOG.md`](./CHANGELOG.md) into the description field and publish it.\n* After you publish the release, the [deploy pipeline](https://github.com/at-gmbh/cookiecutter-server/actions/workflows/deploy.yml) is triggered on GitHub. It will publish the release directly to [PyPI](https://pypi.org/project/cookiecutter-server/) where everyone can enjoy your latest features.\n\n## Contact\n\nSebastian Straub (sebastian.straub [at] alexanderthamm.com)\n\nDeveloped with \u2764 at [Alexander Thamm GmbH](https://www.alexanderthamm.com/)\n\n## License\n\n Copyright 2021 Alexander Thamm GmbH\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "A local development server to get live previews of cookiecutter templates",
"version": "1.1.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "76b8e1e7d199a93c3104919a343d77adaa169ba69df879c8e826d7908e81ca18",
"md5": "8e57eab83b57919e5b130cac391d58ce",
"sha256": "5ff9dfff2882937545cd58585d100fe49f771ece6af08852e22b13dc402adcab"
},
"downloads": -1,
"filename": "cookiecutter_server-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8e57eab83b57919e5b130cac391d58ce",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 11734,
"upload_time": "2023-01-20T17:08:42",
"upload_time_iso_8601": "2023-01-20T17:08:42.113387Z",
"url": "https://files.pythonhosted.org/packages/76/b8/e1e7d199a93c3104919a343d77adaa169ba69df879c8e826d7908e81ca18/cookiecutter_server-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e60e917b6aaf4eb9d3c3338dac7532ed2e93b24fbe2f61eff9dcb004e9f8cc10",
"md5": "49ec1f773dbe5e0f4fa1066cc7ea27ef",
"sha256": "10c26f7456e818f8159fa20650150991c2e28749a9d4ce3cdcdc148a13fb91ba"
},
"downloads": -1,
"filename": "cookiecutter-server-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "49ec1f773dbe5e0f4fa1066cc7ea27ef",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 7883,
"upload_time": "2023-01-20T17:08:43",
"upload_time_iso_8601": "2023-01-20T17:08:43.819051Z",
"url": "https://files.pythonhosted.org/packages/e6/0e/917b6aaf4eb9d3c3338dac7532ed2e93b24fbe2f61eff9dcb004e9f8cc10/cookiecutter-server-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-20 17:08:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "at-gmbh",
"github_project": "cookiecutter-server",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "cookiecutter-server"
}