Skip to content

Commit

Permalink
Add setup.py and fix up tests (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
mobeigi authored Dec 18, 2020
1 parent ca5b89e commit d15d9e7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ After gathering a list of birthdays for all the users friends for a full year, i
* Scheduler tool to automatically run script periodically (optional)

## Instructions
1. Clone repo
1. Clone repo
`git clone [email protected]:mobeigi/fb2cal.git`
2. Rename `config/config-template.ini` to `config/config.ini` and enter your Facebook email and password (no quotes).
3. Set up pipenv environment
3. Set up pipenv environment
`pipenv install`
4. Run the `fb2cal` module
4. Run the `fb2cal` module
`pipenv run python -m fb2cal`
5. Check the output folder (`out` by default) for the created `birthdays.ics` file

Expand All @@ -58,6 +58,14 @@ It is recommended to run the script **once every 24 hours** to update the ICS fi
* Facebook accounts secured with 2FA are currently not supported (see [#9](../../issues/9))
* During Facebook authentication, a security checkpoint may trigger that will force you to change your Facebook password.

## Testing
1. Set up pipenv environment
`pipenv install`
2. Install the `fb2cal` module
`pipenv run python -m pip install .`
3. Run the `unittests` module on the `tests` folder
`pipenv run python -m unittest discover tests`

## Contributions
Contributions are always welcome!
Just make a [pull request](../../pulls).
Expand Down
4 changes: 3 additions & 1 deletion fb2cal/__meta__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
__author__ = 'Mo Beigi'
__copyright__ = 'Copyright 2019-2020'
__description__ = 'Facebook Birthday Events to ICS file converter'
__email__ = '[email protected]'
__license__ = "GPLv3"
__maintainer__ = 'Mo Beigi'
__status__ = 'Production'
__title__ = 'fb2cal'
__website__ = 'https://git.io/fjMwr'
__version_info__ = (1, 2, 1)
__version__ = '.'.join(map(str, __version_info__))


# Make metadata public to script
__all__ = ['__author__', '__copyright__', '__email__', '__license__', '__maintainer__', '__status__', '__website__', '__version_info__', '__version__']
__all__ = ['__author__', '__copyright__', '__description__', '__email__', '__license__', '__maintainer__', '__status__', '__title__', '__website__', '__version_info__', '__version__']
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from setuptools import setup, find_packages
from fb2cal.__meta__ import __title__, __version__, __description__, __license__, __author__, __email__, __website__

setup(
name=__title__,
version=__version__,
description=__description__,
packages=find_packages(),
license=__license__,
author=__author__,
author_email=__email__,
url=__website__
)
3 changes: 0 additions & 3 deletions tests/test_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,3 @@ def test_friend_in_january(self):
self.assertEqual(friend.profile_picture_uri, 'https://scontent-syd2-1.xx.fbcdn.net/v/t1.0-1/cp0/p60x60/34f34864_10161077510019848_299841799681806933_o.jpg?_nc_cat=107&ccb=2&_nc_sid=7406a8&_nc_ohc=yzAYhtdvoMYAX9Zxo1e&_nc_ht=scontent-syd2-1.xx&tp=27&oh=dc48247e31223151bc5d55781a572e2f&oe=5FD254D0')
self.assertEqual(friend.birthday_day, 17)
self.assertEqual(friend.birthday_month, 1)

if __name__ == '__main__':
unittest.main()

0 comments on commit d15d9e7

Please sign in to comment.