Merge pull request #382 from carpedm20/flit

Use `flit` as our build system
This commit is contained in:
Mads Marquart
2019-01-25 19:14:04 +01:00
committed by GitHub
9 changed files with 91 additions and 107 deletions

View File

@@ -1,6 +1,7 @@
sudo: false
language: python
conditions: v1
python: 3.6
# There are two accounts made specifically for Travis, and the passwords are really only encrypted for obscurity
# The global env variables `client1_email`, `client1_password`, `client2_email`, `client2_password` and `group_id`
@@ -8,9 +9,9 @@ conditions: v1
# The tests are run with `Limit concurrent jobs = 1`, since the tests can't use the clients simultaneously
install:
- pip install -U -r requirements.txt
- pip install -U -r dev-requirements.txt
before_install: pip install flit
# Use `--deps production` so that we don't install unnecessary dependencies
install: flit install --deps production --extras test
cache:
pip: true
@@ -28,63 +29,62 @@ jobs:
# and in `tests.utils.load_client`, we need 6 new sessions per branch. This is usually the point where Facebook
# starts complaining, and we have to manually fix it
# Run online tests in all the supported python versions
- &test-online
if: (branch = master OR tag IS present) AND type != pull_request
stage: online tests
script: scripts/travis-online
# Run online tests in all the supported python versions
- <<: *test-online
python: 2.7
before_install:
- sudo apt-get -y install python3-pip python3-setuptools
- sudo pip3 install flit
install: flit install --python python --deps production --extras test
- <<: *test-online
python: 3.4
- <<: *test-online
python: 3.5
- <<: *test-online
python: 3.6
- <<: *test-online
python: pypy
python: pypy3.5
# Run the expensive tests, with the python version most likely to break, aka. 2
- <<: *test-online
# Only run if the commit message includes [ci all] or [all ci]
if: commit_message =~ /\[ci\s+all\]|\[all\s+ci\]/
python: 2.7
before_install:
- sudo apt-get -y install python3-pip python3-setuptools
- sudo pip3 install flit
install: flit install --python python --deps production --extras test
env: PYTEST_ADDOPTS='-m expensive'
# Run offline tests in all the supported python versions
- &test-offline
# Ideally, it'd be nice to run the offline tests in every build, but since we can't run jobs concurrently (yet),
# we'll disable them when they're not needed, and include them inside the online tests instead
if: not ((branch = master OR tag IS present) AND type != pull_request)
stage: offline tests
script: scripts/travis-offline
# Run offline tests in all the supported python versions
- <<: *test-offline
python: 2.7
before_install:
- sudo apt-get -y install python3-pip python3-setuptools
- sudo pip3 install flit
install: flit install --python python --deps production --extras test
- <<: *test-offline
python: 3.4
- <<: *test-offline
python: 3.5
- <<: *test-offline
python: 3.6
- <<: *test-offline
python: 3.6
- <<: *test-offline
python: pypy
python: pypy3.5
# Deploy to PyPI
- &deploy
stage: deploy
if: branch = master AND tag IS present
- stage: deploy
name: PyPI
if: tag IS present
install: skip
script: skip
deploy:
provider: pypi
user: madsmtm
password:
secure: "VA0MLSrwIW/T2KjMwjLZCzrLHw8pJT6tAvb48t7qpBdm8x192hax61pz1TaBZoJvlzyBPFKvluftuclTc7yEFwzXe7Gjqgd/ODKZl/wXDr36hQ7BBOLPZujdwmWLvTzMh3eJZlvkgcLCzrvK3j2oW8cM/+FZeVi/5/FhVuJ4ofs="
distributions: sdist bdist_wheel
skip_existing: true
# We need the bdist_wheels from both Python 2 and 3
python: 3.6
- <<: *deploy
python: 2.7
provider: script
script: flit publish
on:
tags: true

View File

@@ -1,3 +0,0 @@
include LICENSE
include CONTRIBUTING.rst
include README.rst

View File

@@ -27,17 +27,18 @@ or jump right into the code by viewing the `examples <https://github.com/carpedm
Installation:
.. code-block:: console
.. code-block::
$ pip install fbchat
You can also install from source, by using `setuptools` (You need at least version 30.3.0):
You can also install from source, by using `flit`:
.. code-block:: console
.. code-block::
$ pip install flit
$ git clone https://github.com/carpedm20/fbchat.git
$ cd fbchat
$ python setup.py install
$ flit install
Maintainer

View File

@@ -1,2 +0,0 @@
pytest
six

View File

@@ -1,12 +1,7 @@
# -*- coding: UTF-8 -*-
"""Facebook Chat (Messenger) for Python
"""
fbchat
~~~~~~
Facebook Chat (Messenger) for Python
:copyright: (c) 2015 - 2018 by Taehoon Kim
:copyright: (c) 2015 - 2019 by Taehoon Kim
:license: BSD 3-Clause, see LICENSE for more details.
"""
@@ -18,7 +13,7 @@ __title__ = 'fbchat'
__version__ = '1.5.0'
__description__ = 'Facebook Chat (Messenger) for Python'
__copyright__ = 'Copyright 2015 - 2018 by Taehoon Kim'
__copyright__ = 'Copyright 2015 - 2019 by Taehoon Kim'
__license__ = 'BSD 3-Clause'
__author__ = 'Taehoon Kim; Moreels Pieter-Jan; Mads Marquart'

52
pyproject.toml Normal file
View File

@@ -0,0 +1,52 @@
[build-system]
requires = ["flit"]
build-backend = "flit.buildapi"
[tool.flit.metadata]
module = "fbchat"
author = "Taehoon Kim"
author-email = "carpedm20@gmail.com"
maintainer = "Mads Marquart"
maintainer-email = "madsmtm@gmail.com"
home-page = "https://github.com/carpedm20/fbchat/"
requires = [
"aenum",
"requests",
"beautifulsoup4",
]
description-file = "README.rst"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Communications :: Chat",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4.0"
keywords = "Facebook FB Messenger Library Chat Api Bot"
license = "BSD 3-Clause"
[tool.flit.metadata.urls]
Documentation = "https://fbchat.readthedocs.io/"
Repository = "https://github.com/carpedm20/fbchat/"
[tool.flit.metadata.requires-extra]
test = [
"pytest~=4.0",
"six",
]

View File

@@ -1,3 +0,0 @@
requests
beautifulsoup4
aenum

View File

@@ -1,48 +0,0 @@
[metadata]
name = fbchat
version = attr: fbchat.__version__
license = BSD 3-Clause
license_file = LICENSE
author = Taehoon Kim
author_email = carpedm20@gmail.com
maintainer = Mads Marquart
maintainer_email = madsmtm@gmail.com
description = Facebook Chat (Messenger) for Python
long_description = file: README.rst
long_description_content_type = text/x-rst
keywords = Facebook FB Messenger Chat Api Bot
classifiers =
Development Status :: 3 - Alpha
Intended Audience :: Developers
Intended Audience :: Information Technology
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Natural Language :: English
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Topic :: Communications :: Chat
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Software Development :: Libraries :: Python Modules
url = https://github.com/carpedm20/fbchat/
project_urls =
Documentation = https://fbchat.readthedocs.io/
Repository = https://github.com/carpedm20/fbchat/
[options]
zip_safe = True
include_package_data = True
packages = find:
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4.0
install_requires =
aenum
requests
beautifulsoup4

View File

@@ -1,8 +0,0 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from setuptools import setup
setup()