diff --git a/.github/workflows/test-fb2cal.yml b/.github/workflows/test-fb2cal.yml index 126c90f..f99c071 100644 --- a/.github/workflows/test-fb2cal.yml +++ b/.github/workflows/test-fb2cal.yml @@ -12,10 +12,10 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: - python-version: ['3.6', '3.11'] + python-version: ['3.9', '3.12'] steps: - uses: actions/checkout@v3 diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..5f6775c --- /dev/null +++ b/Pipfile @@ -0,0 +1,10 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "fb2cal" + +[packages] +mechanicalsoup = "*" +ics = ">=0.6" +requests = "*" +freezegun = "*" diff --git a/README.md b/README.md index b398db3..746a0b7 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ After gathering a list of birthdays for all the users friends for a full year, i ## Requirements * Facebook account -* Python 3.6+ +* Python 3.9+ * pipenv * Scheduler tool to automatically run script periodically (optional) diff --git a/fb2cal/__meta__.py b/fb2cal/__meta__.py index 589940c..c527a89 100644 --- a/fb2cal/__meta__.py +++ b/fb2cal/__meta__.py @@ -2,14 +2,16 @@ __copyright__ = 'Copyright 2019-2020' __description__ = 'Facebook Birthday Events to ICS file converter' __email__ = 'me@mobeigi.com' +__keywords__ = ['facebook', 'birthday', 'calendar', 'export', 'ics'] __license__ = "GPLv3" __maintainer__ = 'Mo Beigi' __status__ = 'Production' __title__ = 'fb2cal' -__website__ = 'https://git.io/fjMwr' __version_info__ = (1, 2, 4) __version__ = '.'.join(map(str, __version_info__)) +__website__ = 'https://git.io/fjMwr' +__download_url__= f'https://github.com/mobeigi/fb2cal/archive/v{__version__}.tar.gz' # Make metadata public to script -__all__ = ['__author__', '__copyright__', '__description__', '__email__', '__license__', '__maintainer__', '__status__', '__title__', '__website__', '__version_info__', '__version__'] +__all__ = ['__author__', '__copyright__', '__description__', '__email__', '__license__', '__maintainer__', '__status__', '__title__', '__version_info__', '__version__', '__website__', '__download_url__'] diff --git a/fb2cal/utils.py b/fb2cal/utils.py index f059272..dbe9a37 100644 --- a/fb2cal/utils.py +++ b/fb2cal/utils.py @@ -8,10 +8,4 @@ def generate_facebook_profile_url_permalink(facebook_user: FacebookUser): # Facebook prepends an infinite while loop to their API responses as anti hijacking protection # It must be stripped away before parsing a response as JSON def remove_anti_hijacking_protection(text: str): - return remove_prefix(text, "for (;;);") - -# Replace with str.removeprefix in Python 3.9+ -def remove_prefix(text, prefix): - if text.startswith(prefix): - return text[len(prefix):] - return text + return text.removeprefix("for (;;);") diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..0d9f081 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +description-file = README.md diff --git a/setup.py b/setup.py index b998918..2d1546d 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ from setuptools import setup, find_packages -from fb2cal.__meta__ import __title__, __version__, __description__, __license__, __author__, __email__, __website__ +from fb2cal.__meta__ import __title__, __version__, __description__, __license__, __author__, __email__, __min_python_version__, __website__, __download_url__, __keywords__ setup( name=__title__, @@ -9,5 +9,25 @@ license=__license__, author=__author__, author_email=__email__, - url=__website__ + url=__website__, + download_url=__download_url__, + keywords=__keywords__, + python_requires='>3.9', + install_requires=[ + 'MechanicalSoup', + 'ics>=0.6', + 'requests', + 'freezegun', + ], + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Other Audience', + 'Topic :: Scientific/Engineering :: Information Analysis', + 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + ], )