From 1f95ff627cc452a7914c7525438ae8acfde70c42 Mon Sep 17 00:00:00 2001 From: Adams Pierre David <57180807+adamspd@users.noreply.github.com> Date: Tue, 21 Nov 2023 05:38:38 +0100 Subject: [PATCH] updated documentation, workflow --- .github/workflows/codecov.yml | 23 +++++++++++ .github/workflows/publish.yml | 6 ++- README.md | 40 ++++++++++++------- appointment/__init__.py | 7 ++++ check_version.py | 13 ++++-- .../migration_guides/latest.md | 0 .../release_notes/latest.md | 0 setup.cfg | 8 ---- setup.py | 12 ++++++ 9 files changed, 83 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/codecov.yml rename migration_guide_v2.1.0.md => docs/migration_guides/latest.md (100%) rename release_notes.md => docs/release_notes/latest.md (100%) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..800f1fc --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,23 @@ +name: Codecov Coverage + +on: + push: + branches-ignore: + - 'main' + workflow_dispatch: + +jobs: + running_tests: + runs-on: ubuntu-20.04 + strategy: + max-parallel: 4 + matrix: + python-version: [3.10.5] + fail-fast: [false] + + steps: + - uses: actions/checkout@v3 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b2fd9f3..18547c1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,15 +25,19 @@ jobs: # Check if the current version is already on PyPI - name: Check version on PyPI + id: version_check run: | - python check_version.py # This script now checks against real PyPI + python check_version.py + continue-on-error: true # Build the package (folder exclusion is handled by MANIFEST.in) - name: Build package + if: steps.version_check.outputs.version_exists != 'true' run: | python setup.py sdist bdist_wheel - name: Upload to PyPI + if: steps.version_check.outputs.version_exists != 'true' env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} diff --git a/README.md b/README.md index e5e435f..02c1212 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,17 @@ ![Tests](https://github.com/adamspd/django-appointment/actions/workflows/tests.yml/badge.svg) ![Published on PyPi](https://github.com/adamspd/django-appointment/actions/workflows/publish.yml/badge.svg) +[![PyPI version](https://badge.fury.io/py/django-appointment.svg)](https://badge.fury.io/py/django-appointment) +[![codecov](https://codecov.io/gh/adamspd/django-appointment/branch/main/graph/badge.svg?token=ZQZQZQZQZQ)](https://codecov.io/gh/adamspd/django-appointment) +[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/commits/main) +[![GitHub last commit](https://img.shields.io/github/last-commit/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/commit/main) +[![GitHub issues](https://img.shields.io/github/issues/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/issues) +[![GitHub pull requests](https://img.shields.io/github/issues-pr/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/pulls) +[![GitHub contributors](https://img.shields.io/github/contributors/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/graphs/contributors) ⚠️ **IMPORTANT**: Version 2.1.0 introduces significant database changes. Please read -the [migration guide](https://github.com/adamspd/django-appointment/tree/main/migration_guide_v2.1.0.md) before +the [migration guide](https://github.com/adamspd/django-appointment/tree/main/migration_guides/latest.md) before updating. Django-Appointment is a Django app engineered for managing appointment scheduling with ease and flexibility. It enables @@ -12,10 +20,10 @@ users to define custom configurations for time slots, lead time, and finish time provided. This app proficiently manages conflicts and availability for appointments, ensuring a seamless user experience. -Detailed documentation can be found in the [docs](https://github.com/adamspd/django-appointment/tree/main/docs) -directory. -For changes and migration information, please refer to the release -notes [here](https://github.com/adamspd/django-appointment/tree/main/release_notes.md). +Detailed documentation can be found in +the [docs' directory](https://github.com/adamspd/django-appointment/tree/main/docs). +For changes and migration information, please refer to the [release +notes](https://github.com/adamspd/django-appointment/tree/main/release_notes/latest.md). ## Features ✨ @@ -29,7 +37,7 @@ notes [here](https://github.com/adamspd/django-appointment/tree/main/release_not - **Database Changes ⚠️**: Significant modifications to the database schema. Before updating, ensure you follow the migration steps outlined in - the [migration guide](https://github.com/adamspd/django-appointment/tree/main/migration_guide_v2.1.0.md). + the [migration guide](https://github.com/adamspd/django-appointment/tree/main/migration_guides/latest.md). 1. Introduced a staff feature allowing staff members in a team or system to manage their own appointments. 2. Implemented an admin feature panel enabling staff members and superusers (admins) to manage the system. @@ -40,13 +48,16 @@ notes [here](https://github.com/adamspd/django-appointment/tree/main/release_not working hours, and buffer time between appointments. However, only admins have the privilege to add/remove services. ### Breaking Changes in version 2.1.0: + - None ### New Features 🆕 -See the [release notes](release_notes.md#Updates) for more information. + +See the [release notes](docs/release_notes/latest.md#Updates) for more information. ### Fixes 🆕 -See the [release notes](release_notes.md#Bug-Fixes) for more information. + +See the [release notes](docs/release_notes/latest.md#Bug-Fixes) for more information. ## Quick Start 🚀 @@ -83,8 +94,7 @@ See the [release notes](release_notes.md#Bug-Fixes) for more information. ``` If you're utilizing the default Django user model, there's no need to add this line since Django automatically sets - it - to: + it to: ```python AUTH_USER_MODEL = 'auth.User' @@ -106,8 +116,7 @@ See the [release notes](release_notes.md#Bug-Fixes) for more information. ``` And the current year is 2023, the password will be "Chocolates2023". If `APPOINTMENT_WEBSITE_NAME` is not provided, - the - default value is "Website", rendering the password as "Website2023". + the default value is "Website", rendering the password as "Website2023". This name is also utilized in the footer of the emails sent to clients upon scheduling an appointment: @@ -127,8 +136,7 @@ See the [release notes](release_notes.md#Bug-Fixes) for more information. ## Customization 🔧 1. In your Django project's `settings.py`, you can override the default values for the appointment scheduler. More - information regarding available configurations can be found in the - documentation [here](docs/README.md#configuration). + information regarding available configurations can be found in the [documentation](docs/README.md#configuration). 2. Modify these values as needed for your application, and the app will adapt to the new settings. 3. For further customization, you can extend the provided models, views, and templates or create your own. @@ -140,3 +148,7 @@ directory or visit the GitHub repository for more information. ## Notes 📝⚠️ Currently, the application does not send email reminders yet. + +## About the Author + +Adams Pierre David - [Website](https://adamspierredavid.com/) \ No newline at end of file diff --git a/appointment/__init__.py b/appointment/__init__.py index e69de29..6e39aea 100644 --- a/appointment/__init__.py +++ b/appointment/__init__.py @@ -0,0 +1,7 @@ +__author__ = "Adams Pierre David" +__author_email__ = "adamspd.developer@gmail.com" +__author_website__ = "https://adamspierredavid.com/" +__description__ = "Managing appointment scheduling with customizable slots, staff features, and conflict handling." +__package_name__ = "django-appointment" +__url__ = "https://github.com/adamspd/django-appointment" +__version__ = "2.1.1" diff --git a/check_version.py b/check_version.py index fbf5c36..08dcdc9 100644 --- a/check_version.py +++ b/check_version.py @@ -1,11 +1,18 @@ import requests +from appointment import __version__, __package_name__ -package_name = "django-appointment" -current_version = "2.1.1" +package_name = __package_name__ +current_version = __version__ response = requests.get(f"https://pypi.org/pypi/{package_name}/json") + +version_exists = False + if response.status_code == 200: released_versions = response.json()["releases"].keys() if current_version in released_versions: print(f"Version {current_version} already exists on PyPI!") - exit(1) + version_exists = True + +# Output for GitHub Actions +print(f"::set-output name=version_exists::{version_exists}") diff --git a/migration_guide_v2.1.0.md b/docs/migration_guides/latest.md similarity index 100% rename from migration_guide_v2.1.0.md rename to docs/migration_guides/latest.md diff --git a/release_notes.md b/docs/release_notes/latest.md similarity index 100% rename from release_notes.md rename to docs/release_notes/latest.md diff --git a/setup.cfg b/setup.cfg index 6f5310c..5317196 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,12 +1,4 @@ [metadata] -name = django-appointment -version = 2.1.1 -description = Managing appointment scheduling with customizable slots, staff features, and conflict handling. -url = https://github.com/adamspd/django-appointment -author = Adams Pierre David -author_email = adamspd.developer@gmail.com -author_website = https://adamspierredavid.com/ -readme = README.md license = Apache License 2.0 classifiers = Environment :: Web Environment diff --git a/setup.py b/setup.py index 950b203..52a2b93 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,21 @@ import setuptools +from appointment import __author__, __author_email__, __author_website__, __description__, __package_name__, __url__, \ + __version__ + with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( + name=__package_name__, + version=__version__, + author=__author__, + author_email=__author_email__, long_description=long_description, long_description_content_type="text/markdown", + url=__url__, + description=__description__, + project_urls={ + "Author Website": __author_website__, + }, )