Commit graph

660 commits

Author SHA1 Message Date
Rogério Brito
a2d319484a CONTRIBUTING: Be more detailed in how we prefer contributions.
I have had to ask "why should we change from tool <foo> to <bar>" a few
times now for the project and some of the commit messages seem like they
could have already have answered all these questions beforehand.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-30 09:25:06 -03:00
Rogério Brito
98f89d2d37 CONTRIBUTING.md: Update information for pytest instead of nose.
We also make sure that we recommend the installation of both the "regular"
dependencies and the "development" dependencies via `pip`.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-30 08:30:10 -03:00
Rogério Brito
0c275f335b setup: Specify the platform (to be platform agnostic).
This is essentially a cherry-pick of a previous commit of issue #345. As I
am not going to merge that, I am including its message here:

    This may (or may not) be a cosmetic thing, but, otherwise, the generate
    `PKG-INFO` file gets the platform listed as unknown, and I clearly don't
    want it to be that way.

This closes #345.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-30 08:23:45 -03:00
Rogério Brito
7d2a091025 MANIFEST.in: Include also the license in the sdist. 2015-04-28 18:43:26 -03:00
Rogério Brito
286160915e MANIFEST.in: Include all of our documents. 2015-04-28 18:43:06 -03:00
Rogério Brito
37f7737650 MANIFEST.in: Add list of files to generate a proper sdist.
Otherwise, the missing files would break installation of the generated
tarball.

I am pretty sure that there are better ways to do this and I welcome any
solution that is more elegant than this.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-27 07:32:16 -03:00
Rogério Brito
f8f9cd6a31 requirements: Move coverage from regular requirements to -dev version. 2015-04-26 18:25:16 -03:00
Rogério Brito
194721a0ec setup: Add some real keywords. 2015-04-26 13:41:21 -03:00
Rogério Brito
7b6ab0a475 coursera: test: Some whitespace love. 2015-04-26 13:19:23 -03:00
Rogério Brito
2bb31d5191 coursera: test: Use regular assert for equalities.
Since py.test allows us to use regular `assert` instead of `assertEquals`,
use that instead, since it makes some of the code clearer to me, at least.

There is more of this kind of change to come, once I get more into our
testing suite.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-26 13:17:21 -03:00
Rogério Brito
955bf9f200 coursera: cookies: Remove unused import.
We are only using `AUTH_URL_V3` for authentication, since `AUTH_URL` seems
to not be sufficient for on-demand courses.
2015-04-26 13:11:27 -03:00
Rogério Brito
f744144190 gitignore: Ignore tox's working directory. 2015-04-26 12:41:14 -03:00
Rogério Brito
c0f56812cc Merge pull request #335 from FedericoCeratto/tox
From @FedericoCeratto pull request:

----

Add Tox support for unit/functional testing. It help testing different versions of Python.
fabfile.py already contains a target to run Tox.

The result.xml files can be parsed with https://github.com/FedericoCeratto/tox-pytest-summary

----

Thanks @FedericoCeratto for the contribution.
2015-04-25 05:36:58 -03:00
Rogério Brito
e4d72131e1 travis: Since we ignore python 3.5, ignore also python 3.2.
Python 3.2 has not been present in our list of tested environments anyway.

I would like to put it back, but only after I figure out how to ignore
failures with it (and we will most likely have failures with Python 3.2, due
to the str/unicode syntax changes).
2015-04-23 01:06:06 -03:00
Rogério Brito
e905fa5094 travis: Remove nightly.
I give up with this yaml syntax that I don't know how it is supposed to be.
Let's get back to being conservative and ignoring the presence of Python
3.5.
2015-04-23 01:04:46 -03:00
Rogério Brito
a5e33f0dc7 travis: Put nightly at the beginning of the alowed failures.
I don't quite get what the supposed syntax for this should be, but it seems
that travis considers only the first 2 entries when allowing failures.

While we are at it, we also remove 2.6 from the allowed failures, as that's
really a version that we want to support.
2015-04-23 00:56:38 -03:00
Rogério Brito
c4a6a6aff8 travis: Change syntax of the allow_failures option. 2015-04-23 00:51:02 -03:00
Rogério Brito
65cba79d0b travis: Actually use requirements-dev.txt 2015-04-23 00:47:18 -03:00
Rogério Brito
d675f5d629 requirements: Add module from .travis to requirements-dev.
This way, we get a self-contained requirements-dev and we make good use of
the DRY principle.
2015-04-23 00:45:50 -03:00
Rogério Brito
22e56a3ace requirements: Move development related files to the -dev file.
This way, our users don't have to install more packages than what is
necessary to get a running environment.
2015-04-23 00:43:38 -03:00
Rogério Brito
a09119957e requirements: Remove nose, as we transitioned to pytest. 2015-04-23 00:42:31 -03:00
Rogério Brito
bc69b77d9b travis: Add support for testing with nightlies.
Apart from the syntax to ignore the failures (not really sure if that's
correct), I hope that this allows us to claim that we work with Python 3.5
at the moment (as that's the version that is being developed right now).

I based all these guesses of mine on:

    https://github.com/travis-ci/travis-build/pull/404

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-23 00:28:41 -03:00
Rogério Brito
b9e41c1004 setup: Add pypy to supported implementations.
Just copied classifiers for CPython and PyPy from:

   https://pypi.python.org/pypi?%3Aaction=list_classifiers

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-23 00:21:51 -03:00
Rogério Brito
90dcfb7da0 setup: Be more specific about Python versions supported.
I'm not really sure if we should declare compatibility with Python 3.2.
While we also test for pypy (via Travis CI), I am not really sure how to
specify that in the file (I still have to do some reading).

Also, I don't really expect any problems with the use of Python 3.5, but
since it is not (yet) tested with travis, I'm not yet putting it explicitly
here.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-23 00:16:36 -03:00
Rogério Brito
1862f1b372 setup: Specify what Python versions we support.
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-23 00:14:16 -03:00
Rogério Brito
4881f5618e gitignore: Ignore some files/directories created by setup.py. 2015-04-19 01:59:46 -03:00
Rogério Brito
f97014668b setup.py: Declare encoding for the python interpreter. 2015-04-19 01:59:13 -03:00
Rogério Brito
28ae8aca77 setup.py: Fill in some data.
This is still not really satisfactory, as it seems that we have a limitation
in the number of authors (or it seems that we should use an ad-hoc format)
for specifying who the authors are, according to various sources, including:

https://docs.python.org/2/distutils/setupscript.html#additional-meta-data

For that reason, I refrained from telling that I am an (the?) author of this
program, as John should be equally credited here, if not more.  I only
listed myself as the maintainer of the program.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-04-19 01:55:16 -03:00
Rogério Brito
5f36129186 gitignore: Ignore HTML data generated by coverage. 2015-04-17 00:46:01 -03:00
Rogério Brito
dd2454fa4b Merge pull request #338 from meejah/pytest
Add refactored tests from @meejah to better use py.test.

Thanks @meejah for the nice and instructive contribution!
2015-04-16 15:05:45 -03:00
meejah
0e2bf19d40 refactor where the test-body lives, and parametrize the rest 2015-04-16 10:29:56 -06:00
meejah
950f4998b8 use parametrized test-case instead of multiple tests 2015-04-16 10:29:56 -06:00
meejah
55156a8f04 factor out assert helpers from test_cookies 2015-04-16 10:29:56 -06:00
meejah
6bf7a734a3 first-cut setup.py
needs filling in of author information, trove classifiers,
and probably needs a MANIFEST.in or similar, too?
2015-04-16 10:29:56 -06:00
Rogério Brito
c38c841a11 Merge pull request #334 from FedericoCeratto/pytest
Convert the test suite from nose to py.test.

Thanks @FedericoCeratto for the contribution.
2015-04-15 17:16:31 -03:00
Federico Ceratto
d04578d121 Switch to py.test 2015-04-14 11:54:43 +01:00
Federico Ceratto
7ebc4abc4e Add tox.ini 2015-04-14 10:50:21 +01:00
Rogério Brito
75970817fe README: Add me as a contact for the program. 2015-04-14 00:02:46 -03:00
Rogério Brito
adf73f2140 README: Ask the users for the output with --debug passed. 2015-04-14 00:02:28 -03:00
Rogério Brito
c66b6cc18c README: Be more emphatic about ondemand courses. 2015-04-14 00:01:56 -03:00
Rogério Brito
f44ec2c0d3 README: Reformat some parts of the document. 2015-04-14 00:01:24 -03:00
Rogério Brito
4c687a1ee5 README: Add recommended installation method for Unix-like systems. 2015-04-13 23:39:05 -03:00
Rogério Brito
0fdc0e2cb3 README: Reinforce that pip is the only supported method for dependencies. 2015-04-13 22:54:25 -03:00
Rogério Brito
6ed5324cec README: Reword some parts to be clearer. 2015-04-13 22:53:35 -03:00
Rogério Brito
bbc288650a Minor PEP-8 fixes. 2015-04-09 21:22:57 -03:00
Rogério Brito
0300dc6944 Fix indentation. 2015-04-08 01:29:34 -03:00
Rogério Brito
e524044827 Minor readability changes. 2015-04-08 01:28:50 -03:00
Rogério Brito
04714019aa requirements: Reflect our needed requirements. 2015-04-07 20:00:34 -03:00
Rogério Brito
46320cfec9 coursera: cookies: Restrict TLS to version 1.0.
After a considerable amount of RTFM, I try to summarize here what I
discovered, namely, that the problem is actually a conjunction of many
things:

* Python 2.6 and 2.7.x (with x <= 8) don't define the constants
  `ssl.PROTOCOL_TLSv1_1` and `ssl.PROTOCOL_TLSv1_2`. [They were introduced
  with Python 2.7.9][0]

* Having TLS v1.1 and TLS v1.2 seem to only be available with sufficiently
  new versions of OpenSSL. Again, this is reading from [the Python docs][0].

* urllib3, as a result, doesn't seem to support explicitly specifying which
  which version of TLS to use, as far as I can see it (both by reading the
  reading the code and by reading
  https://github.com/shazow/urllib3/issues/487#issuecomment-59382798).

[0]: https://docs.python.org/2/library/ssl.html?highlight=ssl#ssl.PROTOCOL_TLSv1

Therefore, I guess that the best that we can do so far is to only request
`ssl.PROTOCOL_TLSv1` to be used. While it seems that TLS v1.0 has issues, I
hope that the packages we depend on manage to find a way to negotiate higher
versions of TLS, so that we can change that accordingly in the future.

A not so good alternative to that would be to decide dynamically (and
monkeypatch) urllib3 to see which TLS protocols we have and what we can try
to convice it to be used.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-03-29 17:12:35 -03:00
Rogério Brito
0ad0f4cdf5 Merge branch 'mxamin-sslissue'.
This is a first step to fix the fact that Coursera seems to have disabled
SSLv3 from their site.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-03-29 17:10:56 -03:00