Skip to content

Commit

Permalink
Merge pull request #114 from mobeigi/113-bump-python-to-3.9
Browse files Browse the repository at this point in the history
Closes #113: Bump minimum Python to 3.9
  • Loading branch information
mobeigi authored Dec 25, 2023
2 parents a3c0b75 + fe55b05 commit 49b80f1
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-fb2cal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "fb2cal"

[packages]
mechanicalsoup = "*"
ics = ">=0.6"
requests = "*"
freezegun = "*"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 4 additions & 2 deletions fb2cal/__meta__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
__copyright__ = 'Copyright 2019-2020'
__description__ = 'Facebook Birthday Events to ICS file converter'
__email__ = '[email protected]'
__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__']
8 changes: 1 addition & 7 deletions fb2cal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (;;);")
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
24 changes: 22 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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__,
Expand All @@ -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',
],
)

0 comments on commit 49b80f1

Please sign in to comment.