From 7cd046f3a8d73103343176e92a277b9577c8420b Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Sun, 20 Feb 2022 15:35:40 +0200 Subject: [PATCH 01/13] Add documentation: README and better test calendar. --- README.md | 74 +++++++++++++++++++++++++++++++++++++- example/test_calendar.yaml | 28 +++++++++++---- 2 files changed, 94 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 674077f..a1ba192 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,27 @@ # YAML to iCalendar (ics) -Please see `example/test_calendar.yaml` for example entries. +Convert YAML files to .ics files which can be imported into other +calendar applications. + +Features include: +- Converting single .yaml files, or combining multiple into one .ics + file. +- ics fields: summary, description, location +- Specify event start+end or start+duration +- Recurring events (basic support) +- All-day events +- Timezone specification (default or per-event) + + + +## Installation + +There is no PyPI installation yet. Requirements are in +`requirements.txt` and `yaml2ics.py` is a stand-alone script. + + + +## Usage To produce a calendar from a list of events: @@ -14,8 +35,59 @@ To combine lists of events in to a calendar: python yaml2ics.py example/test_calendar.yaml example/another_calendar.yaml ``` + + +## Syntax + +Please see `example/test_calendar.yaml` for a full demo including +explanations. Below is a minimal template that shows the basic idea: + +```yaml +name: Calendar Name +timezone: Europe/Helsinki # default timezoene for events, optional + +events: + - summary: The event title + begin: 2021-09-21 15:00:00 + duration: + minutes: 30 + location: | + https://meet.jit.si/example + description: | + In this meeting we will ... +``` + + + +## Contributing + +``requirements.dev.txt` contains the development requirements. + To test: ``` PYTHONPATH=. pytest ``` + +[black](https://github.com/psf/black) is used to auto-format files +(and enforced by CI). To install git hooks, use `pre-commit install`. +To run the tests/auto-formatting manually, use `pre-commit run +--all-files`. + + + +## Development status + +Contributions welcome. + +Currently alpha or beta: it works and is used, but mostly used by +those who contribute to it. Expect bugs to still be found (and for +the best response, you probably want to dig into the problem to give +us a starting point). + + + +## See also + +* https://github.com/priyeshpatel/yaml-to-ical - older (~2014) idea of + the same thing diff --git a/example/test_calendar.yaml b/example/test_calendar.yaml index b38b451..12b77cf 100644 --- a/example/test_calendar.yaml +++ b/example/test_calendar.yaml @@ -1,20 +1,34 @@ name: Test Calendar timezone: America/Los_Angeles +# Include another list of events in with these. Note you can also do +# this from the command line. +#include: +# - other_calender.ics events: - summary: Event of the Century - begin: 2021-09-21 15:00:00 - end: 2021-09-21 15:30:00 - description: | - Meet the team on the northern side of the field. - - - summary: Half-an-hour meeting - begin: 2021-09-23 15:00:00 -07:00 + begin: 2021-09-21 15:00:00 # uses default timezone above duration: minutes: 30 + description: | + Meet the team on the northern side of the field. location: | Office 224, Monolith Bldg, Office Block C + - summary: Half-an-hour meeting + begin: 2021-09-23 15:00:00 -07:00 # explicit timezone offset + end: 2021-09-23 15:30:00 -07:00 # explicit timezone offset + + - summary: Recurring event + begin: 2022-02-21 15:00:00 + duration: {minutes: 60} + repeat: + interval: + # seconds, minutes, hours, days, weeks, months, years + weeks: 1 + until: 2022-12-31 # required + + # All-day event - summary: Earth Day begin: 2021-04-22 url: https://earthday.org From a0fd5086f9f0f12b0a5e37d4146967780dbe373d Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Mon, 21 Feb 2022 10:04:10 +0200 Subject: [PATCH 02/13] example/test_calendar: Add an example of YAML anchors for templates - YAML provides & to label a node, and ways to refer to it. This allows you to make one template event, and copy it many times changing only one property (such as the begin time. - This adds an example of this into example/test_calendar.yaml --- example/test_calendar.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/example/test_calendar.yaml b/example/test_calendar.yaml index 12b77cf..19f51d9 100644 --- a/example/test_calendar.yaml +++ b/example/test_calendar.yaml @@ -37,3 +37,16 @@ events: # seconds, minutes, hours, days, weeks, months, years years: 1 until: 2030-04-22 + + # We can use a nice trick of YAML (anchors and references) to make a + # series of events that have the same template and only a small + # variation. + # The & is the anchor: it identifies this mapping as 'template-name' + - &template-name + summary: Template event + begin: 2022-02-21 14:00:00 + duration: {minutes: 60} + # This uses the 'template-name' template, and then overrides certain + # fields: in this case, the 'begin'. + - <<: *template-name + begin: 2022-02-28 14:00:00 From 4cc68b346bd08015aaee5db0f373a1730e5b1e02 Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Mon, 21 Feb 2022 09:07:01 +0100 Subject: [PATCH 03/13] Packaging using flit --- .github/workflows/test.yaml | 1 - .gitignore | 72 +++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++ LICENSE.md | 7 ---- pyproject.toml | 37 +++++++++++++++++++ requirements.dev.txt | 2 -- requirements.txt | 3 -- yaml2ics.py | 12 ++++++- 8 files changed, 141 insertions(+), 14 deletions(-) create mode 100644 LICENSE delete mode 100644 LICENSE.md create mode 100644 pyproject.toml delete mode 100644 requirements.dev.txt delete mode 100644 requirements.txt diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ab1801c..7951089 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest pip install -r requirements.txt -r requirements.dev.txt - name: Lint diff --git a/.gitignore b/.gitignore index 96c3ff7..09fe911 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,74 @@ *~ **/__pycache__ +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.coverage +.coverage.* +.cache +coverage.xml +*.cover +*.py,cover +.pytest_cache/ +cover/ + +# General +.DS_Store + +# IntelliJ project files +.idea + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..60d8e2d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 The Scientific Python Group + +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/LICENSE.md b/LICENSE.md deleted file mode 100644 index bc665e8..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2021 The Scientific Python Group - -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/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3c29108 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,37 @@ +[build-system] +requires = ["flit_core >=3.3,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "yaml2ics" +version = "0.0.1" +requires-python = ">=3.8" +authors = [{name = "The Scientific Python Group"}] +readme = "README.md" +license = {file = "LICENSE"} +classifiers = ["License :: OSI Approved :: MIT License"] +dynamic = ["description"] + +dependencies = [ + "ics @ https://github.com/ics-py/ics-py/archive/refs/heads/main.zip", + "python-dateutil", + "pyyaml", +] + +[project.optional-dependencies] +test = [ + "pytest", + "black", + "pre-commit", + "flake8" +] + +[project.scripts] +yaml2ics = "yaml2ics:main" + +[project.urls] +Home = "https://github.com/scientific-python/yaml2ics" +Source = "https://github.com/scientific-python/yaml2ics" + +[tool.flit.sdist] +exclude = ["tests/*"] diff --git a/requirements.dev.txt b/requirements.dev.txt deleted file mode 100644 index efc4154..0000000 --- a/requirements.dev.txt +++ /dev/null @@ -1,2 +0,0 @@ -black==21.5b1 -pre-commit>=2.12 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 469b451..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -https://github.com/ics-py/ics-py/archive/refs/heads/main.zip -python-dateutil -pyyaml diff --git a/yaml2ics.py b/yaml2ics.py index 07d986d..ad3423b 100644 --- a/yaml2ics.py +++ b/yaml2ics.py @@ -1,3 +1,9 @@ +""" +yaml2ics +======== + +CLI to convert yaml into ics. +""" import os import sys from datetime import datetime, tzinfo @@ -135,7 +141,7 @@ def files_to_calendar(files: list) -> ics.Calendar: return calendar -if __name__ == "__main__": +def main(): if len(sys.argv) < 2: print("Usage: yaml2ics.py FILE1.yaml FILE2.yaml ...") sys.exit(-1) @@ -149,3 +155,7 @@ def files_to_calendar(files: list) -> ics.Calendar: calendar = files_to_calendar(files) print(calendar.serialize()) + + +if __name__ == "__main__": + main() From 612e1382f09d252f283c0a179ec1a0f48eccbc02 Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Mon, 21 Feb 2022 09:34:25 +0100 Subject: [PATCH 04/13] ics into requirements and update GH action with cache and flit --- .github/workflows/test.yaml | 13 +++++++++++-- pyproject.toml | 2 +- requirements.txt | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7951089..81ba463 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,14 +17,23 @@ jobs: with: python-version: ${{ matrix.python-version }} + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt -r requirements.dev.txt + pip install -r requirements.txt + pip install flit + flit install - name: Lint run: pre-commit run --all-files --show-diff-on-failure --color always - name: Test run: | - PYTHONPATH=. pytest + pytest diff --git a/pyproject.toml b/pyproject.toml index 3c29108..6a69604 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ classifiers = ["License :: OSI Approved :: MIT License"] dynamic = ["description"] dependencies = [ - "ics @ https://github.com/ics-py/ics-py/archive/refs/heads/main.zip", +# "ics >=0.8", "python-dateutil", "pyyaml", ] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3e8d4bb --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +https://github.com/ics-py/ics-py/archive/refs/heads/main.zip From ffa76f56cb6aa287ff91c9b0601eb7c35339d272 Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Mon, 21 Feb 2022 09:38:39 +0100 Subject: [PATCH 05/13] Add release action --- .github/workflows/release.yml | 31 +++++++++++++++++++++++ .github/workflows/{test.yaml => test.yml} | 0 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml rename .github/workflows/{test.yaml => test.yml} (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..215926e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + push: + tags: + - '*.*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup Python 3.10 + uses: actions/setup-python@v2 + with: + python-version: '3.10' + architecture: 'x64' + + - name: Install flit + run: pip install flit + + - name: Build + run: flit build + + - name: Publish to PyPI + env: + FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }} + FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }} + run: | + flit publish diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/test.yaml rename to .github/workflows/test.yml From ff16689bddfd05fbd5d4c0de9630258ef4307186 Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Mon, 21 Feb 2022 10:06:19 +0100 Subject: [PATCH 06/13] Update readme with package info and dev workflow --- README.md | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index a1ba192..38b0d59 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![PyPI](https://img.shields.io/pypi/v/yaml2ics?style=for-the-badge) + # YAML to iCalendar (ics) Convert YAML files to .ics files which can be imported into other @@ -6,20 +8,24 @@ calendar applications. Features include: - Converting single .yaml files, or combining multiple into one .ics file. -- ics fields: summary, description, location +- ics fields: name, summary, description, location, timezone, repeat - Specify event start+end or start+duration - Recurring events (basic support) - All-day events - Timezone specification (default or per-event) - - ## Installation -There is no PyPI installation yet. Requirements are in -`requirements.txt` and `yaml2ics.py` is a stand-alone script. +``` +pip install yaml2ics +``` +**Note:** due to a pending release of a dependency (`ics-py`), an additional +step is required: +``` +pip install -r requirements.txt +``` ## Usage @@ -35,8 +41,6 @@ To combine lists of events in to a calendar: python yaml2ics.py example/test_calendar.yaml example/another_calendar.yaml ``` - - ## Syntax Please see `example/test_calendar.yaml` for a full demo including @@ -44,7 +48,7 @@ explanations. Below is a minimal template that shows the basic idea: ```yaml name: Calendar Name -timezone: Europe/Helsinki # default timezoene for events, optional +timezone: Europe/Helsinki # default timezoene for events, optional events: - summary: The event title @@ -57,36 +61,30 @@ events: In this meeting we will ... ``` +## Contributing +Contributions are welcomed! This project is still in active development +and should be considered beta. -## Contributing +[flit](https://flit.readthedocs.io/en/latest/) is used to manage the project. -``requirements.dev.txt` contains the development requirements. +``` +pip install flit +pip install -r requirements.txt # temporary workaround for ics-py +flit install -s # make an editable/inplace installation +``` To test: ``` -PYTHONPATH=. pytest +pytest ``` -[black](https://github.com/psf/black) is used to auto-format files -(and enforced by CI). To install git hooks, use `pre-commit install`. +[black](https://github.com/psf/black) and other linters are used to auto-format +files (and enforced by CI). To install the git hooks, use `pre-commit install`. To run the tests/auto-formatting manually, use `pre-commit run --all-files`. - - -## Development status - -Contributions welcome. - -Currently alpha or beta: it works and is used, but mostly used by -those who contribute to it. Expect bugs to still be found (and for -the best response, you probably want to dig into the problem to give -us a starting point). - - - ## See also * https://github.com/priyeshpatel/yaml-to-ical - older (~2014) idea of From c46ef9147f2b94842b73ba16274006eb8cef31d6 Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Mon, 21 Feb 2022 19:29:59 +0100 Subject: [PATCH 07/13] Add warning and 0.1rc1 --- README.md | 6 ++++++ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 38b0d59..5fd090d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ # YAML to iCalendar (ics) +| WARNING: this project is still in beta. Beware of breaking changes! | +|---------------------------------------------------------------------| + Convert YAML files to .ics files which can be imported into other calendar applications. @@ -85,6 +88,9 @@ files (and enforced by CI). To install the git hooks, use `pre-commit install`. To run the tests/auto-formatting manually, use `pre-commit run --all-files`. +Releases are automatically pushed on PyPi by the CI when pushing a tag +following `*.*`. + ## See also * https://github.com/priyeshpatel/yaml-to-ical - older (~2014) idea of diff --git a/pyproject.toml b/pyproject.toml index 6a69604..3c8785e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "yaml2ics" -version = "0.0.1" +version = "0.1rc1" requires-python = ">=3.8" authors = [{name = "The Scientific Python Group"}] readme = "README.md" From 31c4d634fb732772ede3266bdd9fe07cf0923f0a Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Tue, 22 Feb 2022 09:45:56 +0100 Subject: [PATCH 08/13] BSD licensing --- LICENSE | 42 +++++++++++++++++++++++++----------------- pyproject.toml | 2 +- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/LICENSE b/LICENSE index 60d8e2d..22ab7d8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,29 @@ -The MIT License (MIT) +BSD 3-Clause License -Copyright (c) 2021 The Scientific Python Group +Copyright (c) 2021--2022, Scientific Python project +All rights reserved. -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: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -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. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pyproject.toml b/pyproject.toml index 3c8785e..b123acc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ requires-python = ">=3.8" authors = [{name = "The Scientific Python Group"}] readme = "README.md" license = {file = "LICENSE"} -classifiers = ["License :: OSI Approved :: MIT License"] +classifiers = ["License :: OSI Approved :: BSD License"] dynamic = ["description"] dependencies = [ From 2f14c7c5450395580edcf6c4d897c6aa2761cc7a Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Tue, 22 Feb 2022 09:53:26 +0100 Subject: [PATCH 09/13] Update .gitignore --- .gitignore | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/.gitignore b/.gitignore index 09fe911..e1d1111 100644 --- a/.gitignore +++ b/.gitignore @@ -4,42 +4,12 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] -*$py.class # Distribution / packaging -.Python -build/ -develop-eggs/ dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt # Unit test / coverage reports -htmlcov/ -.coverage -.coverage.* -.cache -coverage.xml -*.cover -*.py,cover .pytest_cache/ -cover/ # General .DS_Store @@ -47,16 +17,6 @@ cover/ # IntelliJ project files .idea -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - # Environments .env .venv @@ -69,6 +29,3 @@ venv.bak/ # Spyder project settings .spyderproject .spyproject - -# Rope project settings -.ropeproject From 19cbaddac0e25878a623dd06944095e55cdad079 Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Tue, 22 Feb 2022 09:55:32 +0100 Subject: [PATCH 10/13] Apply suggestions from code review Co-authored-by: Stefan van der Walt --- README.md | 6 +++--- example/test_calendar.yaml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5fd090d..70d6ca5 100644 --- a/README.md +++ b/README.md @@ -51,17 +51,17 @@ explanations. Below is a minimal template that shows the basic idea: ```yaml name: Calendar Name -timezone: Europe/Helsinki # default timezoene for events, optional +timezone: Europe/Helsinki # default timezone for events, optional events: - summary: The event title begin: 2021-09-21 15:00:00 duration: - minutes: 30 + minutes: 30 location: | https://meet.jit.si/example description: | - In this meeting we will ... + In this meeting we will ... ``` ## Contributing diff --git a/example/test_calendar.yaml b/example/test_calendar.yaml index 19f51d9..06248bd 100644 --- a/example/test_calendar.yaml +++ b/example/test_calendar.yaml @@ -1,9 +1,9 @@ name: Test Calendar timezone: America/Los_Angeles -# Include another list of events in with these. Note you can also do -# this from the command line. -#include: -# - other_calender.ics +# # Include another list of events in with these. Note you can also do +# # this from the command line. +# include: +# - other_calender.ics events: - summary: Event of the Century From fb0de34029b49bf5e1ac635562f8ba2a8a60d85b Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Tue, 22 Feb 2022 16:46:10 +0100 Subject: [PATCH 11/13] Better PyPi with token instead of personal password --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 215926e..49fbeaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: - name: Publish to PyPI env: - FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }} - FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }} + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | flit publish From 4b3b2fa64b4ddec130eb6d3f421afc4ef82912b0 Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Tue, 22 Feb 2022 09:57:09 +0100 Subject: [PATCH 12/13] Remove unnecessary information --- README.md | 5 ----- example/test_calendar.yaml | 13 ------------- 2 files changed, 18 deletions(-) diff --git a/README.md b/README.md index 70d6ca5..9a22ec2 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,3 @@ To run the tests/auto-formatting manually, use `pre-commit run Releases are automatically pushed on PyPi by the CI when pushing a tag following `*.*`. - -## See also - -* https://github.com/priyeshpatel/yaml-to-ical - older (~2014) idea of - the same thing diff --git a/example/test_calendar.yaml b/example/test_calendar.yaml index 06248bd..7ea50dc 100644 --- a/example/test_calendar.yaml +++ b/example/test_calendar.yaml @@ -37,16 +37,3 @@ events: # seconds, minutes, hours, days, weeks, months, years years: 1 until: 2030-04-22 - - # We can use a nice trick of YAML (anchors and references) to make a - # series of events that have the same template and only a small - # variation. - # The & is the anchor: it identifies this mapping as 'template-name' - - &template-name - summary: Template event - begin: 2022-02-21 14:00:00 - duration: {minutes: 60} - # This uses the 'template-name' template, and then overrides certain - # fields: in this case, the 'begin'. - - <<: *template-name - begin: 2022-02-28 14:00:00 From 1a5ebedb08506bd8049718c653fe280cfa377607 Mon Sep 17 00:00:00 2001 From: Pamphile Roy Date: Sat, 26 Feb 2022 12:05:36 +0100 Subject: [PATCH 13/13] Use plain pip to install dev env --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9a22ec2..e2be6ba 100644 --- a/README.md +++ b/README.md @@ -69,12 +69,12 @@ events: Contributions are welcomed! This project is still in active development and should be considered beta. -[flit](https://flit.readthedocs.io/en/latest/) is used to manage the project. +To install the development version, fork the source of the project and make an +editable install: ``` -pip install flit pip install -r requirements.txt # temporary workaround for ics-py -flit install -s # make an editable/inplace installation +pip install -e ".[test]" ``` To test: