1. Eduardo Robles Elvira
  2. apscheduler


Eduardo Robles Elvira  committed 07991fe

removing pytz dependency, just using datetime.utcnow instead of datetime.now, as recommended here: http://lucumr.pocoo.org/2011/7/15/eppur-si-muove/

  • Participants
  • Parent commits 6b9ce23
  • Branches default

Comments (0)

Files changed (2)

File apscheduler/scheduler.py

View file
  • Ignore whitespace
 from logging import getLogger
 import os
 import sys
-import pytz
 from apscheduler.util import *
 from apscheduler.triggers import SimpleTrigger, IntervalTrigger, CronTrigger
                     logger.exception('Error notifying listener')
     def _real_add_job(self, job, jobstore, wakeup):
-        job.compute_next_run_time(datetime.now(self.timezone))
+        job.compute_next_run_time(datetime.utcnow())
         if not job.next_run_time:
             raise ValueError('Not adding job since it would never be run')
         for run_time in run_times:
             # See if the job missed its run time window, and handle possible
             # misfires accordingly
-            difference = datetime.now(self.timezone) - run_time
+            difference = datetime.utcnow() - run_time
             grace_time = timedelta(seconds=job.misfire_grace_time)
             if difference > grace_time:
                 # Notify listeners about a missed run
         while not self._stopped:
             logger.debug('Looking for jobs to run')
-            now = datetime.now(self.timezone)
+            now = datetime.utcnow()
             next_wakeup_time = self._process_jobs(now)
             # Sleep until the next job is scheduled to be run,

File setup.py

View file
  • Ignore whitespace
 # coding: utf-8
 import os.path
-from pip.req import parse_requirements
     from setuptools import setup
 import apscheduler
-# parse_requirements() returns generator of pip.req.InstallRequirement objects
-install_reqs = parse_requirements("requirements.txt")
-# reqs is a list of requirement
-# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
-reqs = [str(ir.req) for ir in install_reqs]
 here = os.path.dirname(__file__)
 readme_path = os.path.join(here, 'README.rst')
 readme = open(readme_path).read()
     keywords='scheduling cron',
-    install_requires=reqs,
     packages=('apscheduler', 'apscheduler.jobstores', 'apscheduler.triggers', 'apscheduler.triggers.cron'),