From 8ed3c1b1594e25884f6d144e29e3943ad1b1bdce Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 25 Jan 2019 16:36:09 +0100 Subject: [PATCH 1/6] Use `flit` instead of `setuptools` Mostly just a simple move from `setup.cfg` -> `pyproject.toml`. Had to reformat the description in `__init__` a little though. --- MANIFEST.in | 3 --- README.rst | 9 ++++---- dev-requirements.txt | 2 -- fbchat/__init__.py | 13 ++++------- pyproject.toml | 52 ++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 3 --- setup.cfg | 48 ---------------------------------------- setup.py | 8 ------- 8 files changed, 61 insertions(+), 77 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 dev-requirements.txt create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100755 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 57c2977..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include LICENSE -include CONTRIBUTING.rst -include README.rst diff --git a/README.rst b/README.rst index 718a7f3..88aced4 100644 --- a/README.rst +++ b/README.rst @@ -27,17 +27,18 @@ or jump right into the code by viewing the `examples =2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4.0 -install_requires = - aenum - requests - beautifulsoup4 diff --git a/setup.py b/setup.py deleted file mode 100755 index 3216505..0000000 --- a/setup.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF-8 -*- - -from __future__ import unicode_literals - -from setuptools import setup - -setup() From f921b91c5b809bf8d339067eb860420d7d5b9589 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 25 Jan 2019 16:43:22 +0100 Subject: [PATCH 2/6] Make `travis` use `flit` --- .travis.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 18166dd..5684752 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -71,20 +72,13 @@ jobs: - <<: *test-offline python: pypy - # 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 From d73c8c36270b953374c3ff8bf47b508c3dccbc14 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 25 Jan 2019 17:05:35 +0100 Subject: [PATCH 3/6] Fix travis setup for running `flit` under Python 2.7 --- .travis.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5684752..30b9c69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,19 +29,21 @@ 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 + - pip install flit6 - <<: *test-online python: 3.4 - <<: *test-online python: 3.5 - - <<: *test-online - python: 3.6 - <<: *test-online python: pypy @@ -50,25 +52,29 @@ jobs: # 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 + - pip install flit6 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 + - pip install flit6 - <<: *test-offline python: 3.4 - <<: *test-offline python: 3.5 - - <<: *test-offline - python: 3.6 - - <<: *test-offline - python: 3.6 - <<: *test-offline python: pypy From 7398d4fa2bb31d30e5c213f000a99cfe240c2d19 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 25 Jan 2019 17:14:14 +0100 Subject: [PATCH 4/6] Use `--python` option to properly install the package under Python 2.7 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 30b9c69..61b07b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ jobs: before_install: - sudo apt-get -y install python3-pip python3-setuptools - sudo pip3 install flit - - pip install flit6 + install: flit install --python python --deps production --extras test - <<: *test-online python: 3.4 - <<: *test-online @@ -55,7 +55,7 @@ jobs: before_install: - sudo apt-get -y install python3-pip python3-setuptools - sudo pip3 install flit - - pip install flit6 + install: flit install --python python --deps production --extras test env: PYTEST_ADDOPTS='-m expensive' # Run offline tests in all the supported python versions @@ -70,7 +70,7 @@ jobs: before_install: - sudo apt-get -y install python3-pip python3-setuptools - sudo pip3 install flit - - pip install flit6 + install: flit install --python python --deps production --extras test - <<: *test-offline python: 3.4 - <<: *test-offline From 687afea0f2b29bf9d6343c8d6a2088069b84ae7c Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 25 Jan 2019 17:45:15 +0100 Subject: [PATCH 5/6] Pin minimum `pytest` version to fix tests --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4cd1e50..929a534 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,6 @@ Repository = "https://github.com/carpedm20/fbchat/" [tool.flit.metadata.requires-extra] test = [ - "pytest", + "pytest~=4.0", "six", ] From 1d925a608bffc2eda29bf7d79d1ff72831bf7301 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 25 Jan 2019 18:53:14 +0100 Subject: [PATCH 6/6] Update `pypy` version to 3.5 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61b07b0..f33ca92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ jobs: - <<: *test-online python: 3.5 - <<: *test-online - python: pypy + python: pypy3.5 # Run the expensive tests, with the python version most likely to break, aka. 2 - <<: *test-online @@ -76,7 +76,7 @@ jobs: - <<: *test-offline python: 3.5 - <<: *test-offline - python: pypy + python: pypy3.5 - stage: deploy name: PyPI