Ejemplo n.º 1
0
def fetch_all_py3_projects():
    """
    A job to be run periodically (e.g. daily) to update the
    Python 3 compatible projects from PyPI.
    """
    redis = get_redis()
    with redis.lock('fetch_trove_classifiers'):
        # try to get the old fetch id first
        old_key_name = redis.get(TROVE_KEY_NAME)

        # then populate a set of Python 3 projects in Redis
        new_key_name = uuid.uuid4().hex
        projects = all_py3_projects()
        for project in projects:
            redis.sadd(new_key_name, str(project))
        redis.set(TROVE_KEY_NAME, new_key_name)

        # get rid of the old fetch set if needed
        if old_key_name is not None:
            redis.delete(old_key_name)

        # return number of Python 3 projects
        compatible_count = len(projects)
        redis.set(TROVE_COUNT_KEY, compatible_count)
        return compatible_count
 def test_all_py3_projects(self):
     projects = ciu.all_py3_projects()
     if hasattr(self, 'assertGreater'):
         self.assertGreater(len(projects), 3000)
     else:
         self.assertTrue(len(projects) > 3000)
     self.assertTrue(all(project == project.lower() for project in projects))
     self.assertTrue(ciu.overrides().issubset(projects))
Ejemplo n.º 3
0
 def test_all_py3_projects(self):
     projects = ciu.all_py3_projects()
     if hasattr(self, 'assertGreater'):
         self.assertGreater(len(projects), 3000)
     else:
         self.assertTrue(len(projects) > 3000)
     self.assertTrue(all(project == project.lower()
                         for project in projects))
     self.assertTrue(ciu.overrides().issubset(projects))
Ejemplo n.º 4
0
def check(projects):
    """Check the specified projects for Python 3 compatibility."""
    log = logging.getLogger('ciu')
    log.info('{0} top-level projects to check'.format(len(projects)))
    print('Finding and checking dependencies ...')
    blockers = ciu.blocking_dependencies(projects, ciu.all_py3_projects())

    print('')
    for line in message(blockers):
        print(line)

    print('')
    for line in pprint_blockers(blockers):
        print(' ', line)
def check(projects):
    """Check the specified projects for Python 3 compatibility."""
    log = logging.getLogger('ciu')
    log.info('{0} top-level projects to check'.format(len(projects)))
    print('Finding and checking dependencies ...')
    blockers = ciu.blocking_dependencies(projects, ciu.all_py3_projects())

    print('')
    for line in message(blockers):
        print(line)

    print('')
    for line in pprint_blockers(blockers):
        print(' ', line)
 def test_all_py3_projects(self):
     projects = ciu.all_py3_projects()
     self.assertGreater(len(projects), 3000)
     self.assertTrue(all(project == project.lower() for project in projects))
     self.assertTrue(ciu.OVERRIDES.issubset(projects))