From 3d41bc474db5d8f8c9ab3909ca0df310d7446359 Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Mon, 25 Dec 2023 13:07:18 +1100 Subject: [PATCH 1/8] Update github workflow --- .github/workflows/test-fb2cal.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 606b4a10f9c1f5414a9b80fce2b5ace1297d76c0 Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Mon, 25 Dec 2023 13:09:31 +1100 Subject: [PATCH 2/8] Update README python version required --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 900f21b9a8a2476b5ef00dafacefd6d0421fa2b7 Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Mon, 25 Dec 2023 13:17:30 +1100 Subject: [PATCH 3/8] Add minimum python version to setup tools --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b998918..5ea24fa 100644 --- a/setup.py +++ b/setup.py @@ -9,5 +9,6 @@ license=__license__, author=__author__, author_email=__email__, - url=__website__ + url=__website__, + python_requires='>3.9.0', ) From e9b81c96452c9ee990ace4999fa425b488ecbd75 Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Mon, 25 Dec 2023 13:22:54 +1100 Subject: [PATCH 4/8] Commit Pipfile --- Pipfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Pipfile diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..7354434 --- /dev/null +++ b/Pipfile @@ -0,0 +1,10 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +mechanicalsoup = "*" +ics = ">=0.6" +requests = "*" +freezegun = "*" From 7c67f04ccc2915248299a5f23662a4e1bba2ef3c Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Mon, 25 Dec 2023 13:45:49 +1100 Subject: [PATCH 5/8] Update meta data around Python version and also pypi --- fb2cal/__meta__.py | 6 ++++-- setup.cfg | 2 ++ setup.py | 21 ++++++++++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 setup.cfg 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/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 5ea24fa..c4c23aa 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__, @@ -10,5 +10,24 @@ author=__author__, author_email=__email__, url=__website__, + download_url=__download_url__, + keywords=__keywords__, python_requires='>3.9.0', + 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', + ], ) From 0f37b0db95ae0dea3c810fd6125ed0ac3ea8de26 Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Mon, 25 Dec 2023 13:47:25 +1100 Subject: [PATCH 6/8] Update target source name in Pipfile --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 7354434..5f6775c 100644 --- a/Pipfile +++ b/Pipfile @@ -1,7 +1,7 @@ [[source]] url = "https://pypi.org/simple" verify_ssl = true -name = "pypi" +name = "fb2cal" [packages] mechanicalsoup = "*" From 3e42be1cf43aaf7fdb8b4a8d6bcc8041e49a12a7 Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Mon, 25 Dec 2023 14:01:14 +1100 Subject: [PATCH 7/8] Rewrite util using Py3.9 features --- fb2cal/utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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 (;;);") From fe55b053a24e61f193965cbcddcf242c225ba0b8 Mon Sep 17 00:00:00 2001 From: Mo Beigi Date: Mon, 25 Dec 2023 14:02:11 +1100 Subject: [PATCH 8/8] Remove minor version from python_requires --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c4c23aa..2d1546d 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ url=__website__, download_url=__download_url__, keywords=__keywords__, - python_requires='>3.9.0', + python_requires='>3.9', install_requires=[ 'MechanicalSoup', 'ics>=0.6',