Skip to content

Commit

Permalink
Merge branch 'develop' into dj41
Browse files Browse the repository at this point in the history
  • Loading branch information
llazzaro committed Aug 18, 2022
2 parents 336b7b0 + 13e5938 commit 22db01e
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 80 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,21 @@ jobs:
fail-fast: false
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- "3.10"
tox-environment:
- django31
- django32
- django40
- django41
include:
- python-version: 3.7
tox-environment: django32
# include:
# - python-version: 3.8
# tox-environment: djangomain
# - python-version: 3.9
# tox-environment: djangomain
exclude:
- python-version: 3.6
tox-environment: django40
- python-version: 3.7
tox-environment: django40
- python-version: 3.6
tox-environment: django41
- python-version: 3.7
tox-environment: django41

env:
TOXENV: ${{ matrix.tox-environment }}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
UNRELEASED
==========

- Drop support for Python 3.6.
- Add support for Python 3.10
- Drop support for Django versions before 3.2.

0.9.6 - 2022-04-18
==========

Expand Down
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

8 changes: 4 additions & 4 deletions schedule/models/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ def _create_occurrence(self, start, end=None):

def get_occurrence(self, date):
use_naive = timezone.is_naive(date)
tzinfo = timezone.utc
tzinfo = datetime.timezone.utc
if timezone.is_naive(date):
date = timezone.make_aware(date, timezone.utc)
date = timezone.make_aware(date, tzinfo)
if date.tzinfo:
tzinfo = date.tzinfo
rule = self.get_rrule_object(tzinfo)
Expand Down Expand Up @@ -238,7 +238,7 @@ def _get_occurrence_list(self, start, end):
use_naive = timezone.is_naive(start)

# Use the timezone from the start date
tzinfo = timezone.utc
tzinfo = datetime.timezone.utc
if start.tzinfo:
tzinfo = start.tzinfo

Expand Down Expand Up @@ -293,7 +293,7 @@ def _occurrences_after_generator(self, after=None):
``max_occurrences`` occurrences or has reached ``self.end_recurring_period``, whichever is smallest.
"""

tzinfo = timezone.utc
tzinfo = datetime.timezone.utc
if after is None:
after = timezone.now()
elif not timezone.is_naive(after):
Expand Down
48 changes: 46 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,54 @@
[metadata]
name = django-scheduler
version = 0.9.6
description = A calendaring app for Django.
long_description = file: README.md
long_description_content_type = text/markdown
author = Leonardo Lazzaro
author_email = lazzaroleonardo@gmail.com
url = https://github.com/llazzaro/django-scheduler
license = BSD
license_file = LICENSE.txt
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 2.2
Framework :: Django :: 3.1
Framework :: Django :: 3.2
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Utilities

[options]
include_package_data = True
zip_safe = False
python_requires = >=3.6
install_requires=
Django>=2.2
python-dateutil>=2.1
pytz>=2013.9
icalendar>=3.8.4
packages =
schedule
schedule.feeds
schedule.models
schedule.migrations
schedule.templatetags


[flake8]
ignore =
W503
E501

[metadata]
license_file = LICENSE.txt

[isort]
combine_as_imports = true
Expand Down
52 changes: 1 addition & 51 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,3 @@
#!/usr/bin/env python3
from setuptools import setup

with open("README.md") as fp:
long_description = fp.read()

setup(
name="django-scheduler",
version="0.9.6",
description="A calendaring app for Django.",
long_description=long_description,
long_description_content_type="text/markdown",
author="Leonardo Lazzaro",
author_email="lazzaroleonardo@gmail.com",
url="https://github.com/llazzaro/django-scheduler",
packages=[
"schedule",
"schedule.feeds",
"schedule.models",
"schedule.migrations",
"schedule.templatetags",
],
include_package_data=True,
zip_safe=False,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.1",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Utilities",
],
python_requires=">=3.6",
install_requires=[
"Django>=2.2",
"python-dateutil>=2.1",
"pytz>=2013.9",
"icalendar>=3.8.4",
],
license="BSD",
test_suite="runtests.runtests",
)
setup()
1 change: 1 addition & 0 deletions tests/test_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def test_get_recent_events_with_events_return_the_event(self):

def test_occurrences_after_without_events_is_empty(self):
calendar = Calendar()
calendar.save()
self.assertEqual(list(calendar.occurrences_after(timezone.now())), [])

def test_occurrences_after_with_events_after_returns_events(self):
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[tox]
envlist =
lint
django31
django32
django40
django41
Expand All @@ -10,7 +9,6 @@ envlist =
[testenv]
commands = {envpython} -Wa -b -m coverage run -m django test --settings=tests.settings
deps =
django31: Django~=3.1.0
django32: Django~=3.2.0
django40: Django~=4.0.0
django41: Django~=4.1.0
Expand All @@ -20,7 +18,7 @@ deps =
[testenv:lint]
basepython = python3
commands =
black --target-version py39 --check --diff .
black --target-version py310 --check --diff .
flake8
isort --check-only --diff .
{envpython} -m django check --settings=tests.settings
Expand Down

0 comments on commit 22db01e

Please sign in to comment.