Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write a new documentation page with branch info #1367

Merged
merged 7 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions axelrod/tests/unit/test_tournament.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,13 +732,19 @@ def test_write_to_csv_without_results(self):
self.assertTrue(df.equals(expected_df))

@given(seed=integers(min_value=1, max_value=4294967295))
@example(seed=2)
@settings(max_examples=5, deadline=None)
def test_seeding_equality(self, seed):
"""Tests that a tournament with a given seed will return the
same results each time. This specifically checks when running using
multiple cores so as to confirm that
https://github.com/Axelrod-Python/Axelrod/issues/1277
is fixed."""
is fixed.

Note that the final asserts test only specific properties of the results
sets and not the entire result sets as some floating point errors can
emerge.
"""
rng = axl.RandomGenerator(seed=seed)
players = [axl.Random(rng.random()) for _ in range(8)]
tournament1 = axl.Tournament(
Expand All @@ -758,9 +764,12 @@ def test_seeding_equality(self, seed):
seed=seed
)
for _ in range(4):
results1 = tournament1.play(processes=2)
results2 = tournament2.play(processes=2)
self.assertEqual(results1.ranked_names, results2.ranked_names)
results1 = tournament1.play(processes=2, progress_bar=False)
results2 = tournament2.play(processes=2, progress_bar=False)
self.assertEqual(results1.wins, results2.wins)
self.assertEqual(results1.match_lengths, results2.match_lengths)
self.assertEqual(results1.scores, results2.scores)
self.assertEqual(results1.cooperation, results2.cooperation)

def test_seeding_inequality(self):
players = [axl.Random(0.4), axl.Random(0.6)]
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/contributing/guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The project follows the following guidelines:
from `Chris Beams <https://chris.beams.io/posts/git-commit/>`_
5. Testing: the project uses the `unittest
<https://docs.python.org/2/library/unittest.html>`_ library and has a nice
testing suite that makes some things very easy to write tests for. Please try
testing suite that makes some things easy to write tests for. Please try
to increase the test coverage on pull requests.
6. Merging pull-requests: We require two of the (currently three) core-team
maintainers to merge. Opening a PR for early
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/contributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Contents:
:maxdepth: 2

guidelines.rst
setting_up_the_environment.rst
strategy/index.rst
library/index.rst
running_tests.rst
13 changes: 0 additions & 13 deletions docs/tutorials/contributing/running_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ Running tests
Basic test runners
------------------

Before running tests, you should have hypothesis 3.2 installed::

$ pip install hypothesis==3.2

The project has an extensive test suite which is run each time a new
contribution is made to the repository. If you want to check that all the tests
pass before you submit a pull request you can run the tests yourself::
Expand Down Expand Up @@ -73,12 +69,3 @@ You can also run the type checker on a given file. For example, to run the type
checker on the Grudger strategy::

$ mypy --ignore-missing-imports --follow-imports skip axelrod/strategies/grudger.py


Continuous integration
======================

This project is being taken care of by `travis-ci
<https://travis-ci.org/>`_, so all tests will be run automatically when opening
a pull request. You can see the latest build status `here
<https://travis-ci.org/Axelrod-Python/Axelrod>`_.
32 changes: 32 additions & 0 deletions docs/tutorials/contributing/setting_up_the_environment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Setting up the environment
==========================

Installing all dependencies
---------------------------

All testing dependencies can be installed by running::

$ pip install -r requirements.txt

It is recommended to do this using a virtual environment tool of your choice.
marcharper marked this conversation as resolved.
Show resolved Hide resolved

The git workflow
----------------

There are two important branches in this repository:

- :code:`dev`: The most up to date branch with no failing tests.
This is the default branch on github.
- :code:`release`: The latest release.

When working on a new contribution branch from the latest :code:`dev` branch and
open a Pull Request on github from your branch to the :code:`dev` branch.

The procedure for a new release (this is carried out by one of core maintainers):

1. Create a Pull Request from :code:`dev` to :code:`release` which should
include an update to :code:`axelrod/version.py` and :code:`CHANGES.md`
2. Create a git tag.
3. Push to github.
4. Create a release on github.
5. Push to PyPi: :code:`python setup.py sdist bdist_wheel upload`