Skip to content

Commit

Permalink
improve build
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffy-critter committed Aug 12, 2019
1 parent de841c9 commit c099c29
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 459 deletions.
7 changes: 6 additions & 1 deletion Makefile
@@ -1,4 +1,9 @@
all: pylint flake8
all: format pylint flake8

.PHONY: format
format:
pipenv run isort -y
pipenv run autopep8 -r --in-place .

.PHONY: format
format:
Expand Down
441 changes: 0 additions & 441 deletions Pipfile.lock

This file was deleted.

5 changes: 3 additions & 2 deletions pushl/__init__.py
@@ -1,9 +1,9 @@
""" Functionality to add push-ish notifications to feed-based sites """

import logging
import asyncio
import logging

from . import feeds, caching, entries, webmentions, utils
from . import caching, entries, feeds, utils, webmentions

LOGGER = logging.getLogger("pushl")

Expand Down Expand Up @@ -119,6 +119,7 @@ async def process_entry(self, url, add_domain=False, send_mentions=True):
links = entry.get_targets(self)
if previous:
# Only bother with links that changed from the last time
LOGGER.debug("%s: excluding previously-checked targets", url)
links = links ^ previous.get_targets(self)

for link in links:
Expand Down
3 changes: 1 addition & 2 deletions pushl/__main__.py
@@ -1,14 +1,13 @@
""" Pushl - a tool for pushing updates from a content feed to another destination """

import argparse
import logging
import asyncio
import logging

import aiohttp

from . import Pushl, __version__


LOG_LEVELS = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]

LOGGER = logging.getLogger("pushl.main")
Expand Down
4 changes: 2 additions & 2 deletions pushl/caching.py
@@ -1,9 +1,9 @@
""" Simple caching functions """

import pickle
import logging
import hashlib
import logging
import os
import pickle
import sys

from slugify import slugify
Expand Down
3 changes: 2 additions & 1 deletion pushl/entries.py
@@ -1,8 +1,8 @@
""" Functions for handling entries """

import hashlib
import logging
import urllib.parse
import hashlib

from bs4 import BeautifulSoup

Expand Down Expand Up @@ -129,6 +129,7 @@ async def get_entry(config, url):

# cache hit
if request.cached:
LOGGER.debug("%s: entry unchanged", url)
return previous, previous, False

current = Entry(request)
Expand Down
2 changes: 1 addition & 1 deletion pushl/feeds.py
@@ -1,8 +1,8 @@
""" Functionality for handling feeds """

import logging
import collections
import hashlib
import logging

import feedparser

Expand Down
6 changes: 3 additions & 3 deletions pushl/utils.py
@@ -1,11 +1,11 @@
""" Utility functions """

import re
import asyncio
import logging
import re
import ssl
import sys
import asyncio
import urllib.parse
import ssl

import aiohttp

Expand Down
8 changes: 4 additions & 4 deletions pushl/webmentions.py
@@ -1,13 +1,13 @@
""" Functions for sending webmentions """

from abc import ABC, abstractmethod
import asyncio
import logging
import urllib.parse
from abc import ABC, abstractmethod

import async_lru
from bs4 import BeautifulSoup
from lxml import etree
import async_lru

from . import caching, utils

Expand Down Expand Up @@ -156,8 +156,8 @@ async def send(self, config, entry):
try:
await self.endpoint.send(config, entry.url, self.url)
except Exception as err: # pylint:disable=broad-except
LOGGER.warning("Ping %s: got %s: %s",
self.url, err.__class__.__name__, err)
LOGGER.exception("Ping %s: got %s: %s",
self.url, err.__class__.__name__, err)


@async_lru.alru_cache(maxsize=1000)
Expand Down
5 changes: 3 additions & 2 deletions setup.py
@@ -1,10 +1,11 @@
"""Setup for Pushl packaging"""

# Always prefer setuptools over distutils
from setuptools import setup
from distutils.util import convert_path
from os import path

# Always prefer setuptools over distutils
from setuptools import setup

here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
Expand Down

0 comments on commit c099c29

Please sign in to comment.