* Trial job for asv continuous in travis.
* Print circuit QASM during randomized testing.
* Add coverage to python 3.6 job name.
* Suppress hypothesis filter_too_much health check.
* Reducuce random circuit count from 50 to 25.
* Set python version via command line arg rather than sed.
* Increase travis_wait time to 45m for randomized tests.
* Bump hypothesis version.
* Decrease to 50 random circuits and fail on first first found error.
* Disable hypothesis deadlines.
* Add randomized testing stage to travis.
* Update report_ci_failure to create an issue for failed random tests.
* Remove randomized tests from unit test and coverage.
* Add hypothesis example database to travis cache.
* Add diff-cover output when coverage is collected
This commit adds an additional output stage to the python 3.6 job, which
is used for collecting coverage, that runs the diff-cover tool to show
which parts of the diff have test coverage. This is useful for both
reviewers and the commit author to see if the changes being made in a PR
are actually being exercised by the testing we run.
* Fix typo in coverage.xml filename
* Add coverage collection to CI
This commit adds coverage collection to the CI environment. It adds
reporting back to coveralls for the python 3.6 job. So when that job
finishes executing it will send the collected coverage data to coveralls
so we can track out unit test coverage.
Fixes#771
* Add missing quotes
* Move coveralls to only run on coverage job
The current wheel build automation uploads the wheel files to
test.pypi.org. The idea behind this was to enable manual verification of
the built wheels prior to pushing the releases for real. However, this
just adds another manual process to the release process and increases
the chance of something going wrong. There also isn't any manual
validation that happens for most of the wheels. When it is done, it
provides no more than what the build automation does already
(running an example script). To simplify the release process and reduce
the chances for errors involved with downloading and re-uploading
this commit switches the build automation to directly upload to
pypi.org. The release workflow with this is now just push a tag for the
release, then build and upload a sdist to pypi. Everything else is
automated.
* Install twine in wheel build jobs
The wheel build jobs failed to install twine so when the jobs completed
and went to upload the wheels this failed because the command wasn't
found. This commit fixes the issue by installing twine as part of the
wheel build job set ups so that we can actually upload our built
binaries.
* Pip install -U twine
* Bump cibuildwheel version
Now that terra and other qiskit elements have been released we can
tweak how we install packages in CI for running tests. This commit
updates things so we install terra from source, no longer pin the
ibmq-provider, and removes aer (since there are no tests using it
anymore).
* Add example for stochastic swap and use to verify wheels
This commit adds a new example to the examples directory for running the
stochastic swap pass. This is then used by the wheel build automation
to verify the built wheel works as expected. The compiled code (and
complexity in the wheel build) is for the stochastic swap pass so
verifying it functions when installed from the built wheel is important.
* Test wheel build with new script
Comment out branch logic and wheel upload to verify the wheel build this
is just for testing and will be reverted before the PR merges.
* Remove prints from example
* Revert "Test wheel build with new script"
This reverts commit f5edc1c777.
* Build wheels automatically in CI environment
Right now when it's time to push a relase of qiskit-terra we have to
manually build wheels for all our supported environments because we
included compiled code in the project. This involves setting up a proper
environment with portable librariers and compilers in Linux, Windows,
and Mac OSX with all 3 versions of python we support. Then manually
building the 9 wheels necessary to publish on pypi. However we install
qiskit-terra from source every day multiple times in all these
environments in our CI. There is no reason this manual step needs to
exist and we can just leverage CI to do our wheel building when it's
time to do a release.
This commit adds initial support for building our wheels in travis
(for linux and osx) and appveyor (for windows). It leverages the
cibuildwheel project to automate the wheel building. This will ensure we
setup the proper environment for all 3 python versions on all 3
environments (for example pulling in the manylinux docker container on
linux).
* Add cython to wheel build environment
* Add sudo call to pip
* Skip python 3.4 wheel build
* Fix appveyor syntax
* Setup seperate wheel job on appveyor
* Fix missing quote
* Fix osx env skip typo
* Add wheel tests and twine config to CIBW jobs
This commit adds 2 things. First running tests on the built wheels. This
will enable verifying that the built wheels work by running the unit
tests with terra installed from the wheels. The second is the beginnings
of the twine config. In the next iteration of this patch the wheels will
all be uploaded to test.pypi.org so we can test them locally and then
uploaded them to pypi.org for release on each tag push. (We might bypass
this and go straight to pypi.org in the future) To facilitate this we
need to pass configuration into twine so for when we add twine upload to
the builds it will be able to upload.
* Add missing quotes to test command
* Run tests outside of project directory
* Switch CIBW tests to use unittest instead of stestr
Running tests with stestr assumes you're running inside the python
project for discovery to work. Since we don't want to do that because it
will get confused about whether we mean to run with the installed wheel
or local files. This commit switches to use unittest which will enable
running discovery from any directory so we can run tests against just
the installed wheel to verify that it works correctly.
* Run examples script instead of unittests
The unittests are too coupled to running from inside the repo. Since we
just need to verify the installed wheel works this switches to running
one of the example scripts, teleport.py. This is a good choice because
it will use both python code and cython compiled code to verify the
wheel works as expected.
* Remove unused test requirements
* Fix windows backwards slashes
* Update windows test command
* Add twine upload and only run on tags
* Run wheel build as a deploy on tag in appveyor
* Enable deploy on each run for testing
* Pivot appveyor config to use conditional matrix instead of deploy
* Add twine upload to appveyor
Right now the jobs listed in travis don't have explicit names. You can
pretty easily figure out which jobs do what based on the OS icon and the
environment variables set for each job. But to make it a bit easier just
name each job with a descriptive human readable name so we're explicit
about which each job is doing.
* Add constraints to pin pylint to known working version
This commit adds a constraints file so we're always running pylint and
astroid at known working version. The 2 are requirements are very coupled
and small changes in one often requires an update in the other.
Unfortunately new versions of pylint often change or add rules which
makes running it unpinned not a good decision. To ensure a consistent
environment for running pylint this commit leverages pip constraints to
make sure we always install the same version of astroid and pylint.
* Pin for broken cryptography release today too
* Add Cython files.
* by error
* Modify swap mapper
* cleanup setup.py
* move cythonize to main setup.py
* fix style and add cython to requirements
* have travis build cython before testing
* disable lint checks that fail due to compiled code
* add cython to requirements (the txt one)
* revert to NumPy RandomState RNG for deterministic random generation
* remove unused import
* update tests
* make Cython build more portable
* move cython to dev requirements
* remove unused code
* turn on warnings, and fix old docstring
* fix import errors
* add cython build to appveyor
* add cython to appveyor
* revert aer changes
* fix "ground truth"
* this should not be here
* this should not be here
* this should not be here
* this should not be here
* this should not be here
* this should not be here
* I have no idea why they are saying they are modified
* Add Cython to setup_requires for setup.py
The setup_requires parameter to the setup() function is used to
specify packages that need to be present in order for the setup script
to run. [1] With the introduction of Cython to the setup.py this is now
required to be installed for setup, so this commit adds Cython to
setup_requires to indicate this.
[1] https://setuptools.readthedocs.io/en/latest/setuptools.html
* add to changelog
* Update Cython version in setup_requires
* Aggressively caching pyenv directory.
Most of the time spent on iOS instances came from:
* Updating brew so pyenv is able to install the latest Python
versions.
* Building the Python versions.
The patch removes the need of brew by installing pyenv directly. This
pyenv is then used to build the three Python interpreters that we
support. Now, we cache these builds. Finally we setup the Python
environment in the same way we did before the patch.
Now the fixing downloads and build the three environments thrice in the
worst case (when there is no cache) and updating a Python version, (which
is expected for Python 7) requires clearing the cache.
* Now each version is responsible of the proper Python version
* Restoring tests
* Utility for reporting a CI failure as a GitHub issue.
This PR adds a new tool for creating an issue on GitHub when the
CI fails. The utility identifies the report with the name of the
branch and commit hash an avoids to open two reports for the same
subject.
* Fixing the master is failing label
* Add automatization in CI
* Add test_ci make target, revert make test
Add a new "test_ci" target to the Makefile, aimed at being used by
the CIs. Update the "test" family of targets in order to revert
back to the behaviour that involves less overhead and complexity
for the users.
* Update travis in order to use test_ci
* Add documentation about test_ci target
* Remove documentation deploy
Remove documentation script and travis job.
* Remove deploy stage from travis
Remove the "deploy doc and pypi" stage entirely, and revise the
"subclassing" of the osx jobs.
* Fix travis script make invocation
* Fix extra lint script commands
* Pin numpy version to <1.16
Pin the numpy version to <1.16 until the potential incompatibilities
are fixed.
* Remove numpy from whitelist, ignore random instead
Remove `numpy` from the `extension-pkg-whitelist`, and instead manually
ignore the check for the members of `numpy.random`, as it was the
only place where the check was significant.
Currently the osx jobs are failing trying upgrade the pyenv version to the latest (which is needed to install the python versions we test in CI). According to the travis docs the best way to use homebrew on osx jobs is to rely on the travis addon instead of doing it manually in the install scripts. This commit makes this change so we install the latest version of pyenv (and the python 3.7 dependencies) via the addon instead of out of band. This fixes the failure and makes sure we have the latest versions of the homebrew package installed as needed.
* Find working pyenv versions on osx homebrew
* Switch to travis addon for brew
* Rework travis osx config a bit more
* Remove legacy cpp code
* remove legacy cpp sim from make and travis
* Rename decorator and folder for aer provider tests
* remove Cpp simulator for setup.py
* fixup
* Remove all cmake and cleanup travis config
Since we're no longer building any C++ code there is no need to keep
cmake usage around anymore. This commit removes the last cmake remnants
and also cleans up the travis config to simply run make && make test to
install everything and then just invoke the test runner. It also
deduplicates jobs now that there is no distinction between no_compile
and compile jobs.
* Fix some small oversights
* Remove legacysimulator contributing doc section
* Removing simulators
* Fixing some test
* Fixing test
* Test
* Email
* Fixing test
* Passing locally
* Hack to get aer
* Diego fix
* Trying to fix windows errors
* Aer to basicaer
* Adding lint
* Removing test around and making aer only on one folder.
* Adding HACK FROM THE DEPTHS OF DESPAIR AS AER DOES NOT WORK ON MAC
* Oops Diego hack I did not implement correctly
* Linting
* do not import Aer at the top of tests
* lint
* two more CHANGELOG lines
* Add draw() method on QuantumCircuit class (fixes#1004)
Adds a draw() method to the QuantumCircuit class for
visualizing the circuit. This is basically just an alternative interface
to qiskit.tools.visualization._circuit_drawer() but is more convenient
because it's baked into the quantum circuit. This means users don't have
to import an additional module and can just visualize any circuits after
creating them.
* Add __str__ property to call text output draw to quantumcircuit
This commit adds a __str__ method to the quantumcircuit object. This
will enable users to run print(circuit) and have the text visualizer
output be printed from the circuit.
* Fixes final states for `get_status_job()` support
* Factor out API final states
* Moving job final states to a module level variable to keep consistency with API final states.
* Use Xenial and sudo: true to make Python 3.7 builds to work.
* Adding Python 3.7 to the Travis Matrix for Linux and OSX.
Waiting for Appveyor to support Python 3.7 natively before adding it to the matrix.
* Used pyenv and venvwrapper for both OSX stages.
* Update OSX Python 3.7 stage key
Use fixed Python version on travis osx
Fix the travis python version to 3.6.5 using `pyenv`, as the current
runs use Python 3.7 which seems to cause some issues in some of the
dependencies.
Rename all references to `qiskit-sdk-py` to the new repository name,
`QISKit/qiskit-core`, including a handful of instances where the
`IBM/qiskit-sdk-py` form was used.
* CMake improvements:
* Static linking is not the default anymore.
* Platform Wheel Tag is now configurable via cmake variable.
* Updated documentation
* CI config file updated accordingly
* Added support for Win64 builds on Visual Studio 2017
* Windows C++ Simulator now links with a prebuilt version of
OpenBLAS (64 bits), so there's no need to link against
LAPACK anymore
* cmake added as a dependency
* Restored --static-libgcc flag for static MacOS builds so gcc
can create *semi* static executables again. Clang doesn't have
static compilation.
* Remove default WHEEL_TAG value so if not specified, the tag is
choosen by the wheel module
* Fix the travis stage that performs the linting, making it fail if the
`make style` target fails instead of ignoring it silently.
* Fix the execution of the deploy stages for the jobs that are the
result of a PR against stable. Now the stages are only executed in the
job associated to the push.
* coverage rule in Makefile
* coverage in cmake
* clean coverage rule
* it looks like there is a proper way to remove the coverage data
* cmake: coverage_erase
* Add coverage target to cmake, fix typo
* Fix travis osx brew python (now upgrade)
* Revise the travis configuration for using `cmake` for the several
targets, and use "stages" instead of parallel jobs:
* define three stages that are executed if the previous one suceeds:
1. "linter and pure python test": executes the linter and a test
without compiling the binaries, with the idea of providing quick
feedback for PRs.
2. "test": launch the test, including the compilation of binaries,
under GNU/Linux Python 3.6 and 3.6; and osx Python 3.6.
3. "deploy doc and pypi": for the stable branch, deploy the docs
to the landing page, and when using a specific commit message,
build the GNU/Linux and osx wheels, uploading them to test.pypi.
* use yaml anchors and definitions to avoid repeating code (and
working around travis limitations).
* Modify the `cmake``configuration to accomodate the stages flow:
* allow conditional creation of compilation and QA targets, mainly
for saving some time in some jobs.
* move the tests to `cmake/tests.cmake`.
* Update the tests:
* add a `requires_qe_access` decorator that retrieves QE_TOKEN and
QE_URL and appends them to the parameters in an unified manner.
* add an environment variable `SKIP_ONLINE_TESTS` that allows to
skip the tests that need network access.
* replace `TRAVIS_FORK_PULL_REQUEST` with the previous two
mechanisms, adding support for AppVeyor as well.
* fix a problem with matplotlib under osx headless, effectively
skipping `test_visualization.py` during the travis osx jobs.
* Move Sphinx to `requirements-dev.txt`.
* Relax the pylint output disabling several warnings.
* Reintroduce the linting of qiskit.extensions and qiskit.qasm.node.
* Add a `style` target to the Makefile that performs pycodestyle, and
reduce the verbosity of `lint` by removing the report.
* Update the Travis configuration in order to add a new step that
performs linter and style checks via an environment variable.
* Use flake8 to find syntax errors & undefined names
flake8 testing of https://github.com/QISKit/qiskit-sdk-py on Python 3.6.3
$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./qiskit/dagcircuit/_dagcircuit.py:570:49: F821 undefined name 'n'
nd = input_circuit.multi_graph.node[n]
^
./qiskit/tools/visualization.py:463:70: E999 SyntaxError: EOL while scanning string literal
"""Plot the equal angle slice spin Wigner function of an arbitrary
^
./qiskit/tools/qcvv/tomography.py:805:17: E999 IndentationError: expected an indented block
W[wpt] = W[wpt]+(x[i]/shots)*parity[i]
^
2 E999 IndentationError: expected an indented block
1 F821 undefined name 'n'
3
```
* pylint qiskit test --errors-only
* flake8 --exit-zero to treat all issues as warnings
* pylint --extension-pkg-whitelist=numpy, flake8 E999
* Remove flake8 and focus on pylint
Pylint now finds three issues. I am unable to suggest fixes for the first two. I have suggested a fix for the last issue at f49975ec6e (commitcomment-25627794)
* Fix F821, no-member and logging-too-few-args
Fix issues raised by pylint on "--errors-only" mode, thanks to cclaus.
* Add numpy to the general pylint configuration
* Add runtime check for IBMQuantumExperience version
Add `qiskit._util._check_ibmqe_version()` (invoked on the main import)
for emitting a warning if the installed version of IBMQuantumExperience
does not match the version defined on `setup.py`.
* Rename requires.txt and requires-dev.txt
Rename to "requirements.txt" and "requirements-dev.txt", in order to
conform better to the de-facto practices.
Update the requirements to match the versions specified in setup.py.
* setup.py: OS classifiers, backend, IBMQE version
* Explicitly require IBMQuantumExperience>=1.8.13, as older versions
might not contain all the functionality needed.
* Include "qiskit.backends" as a package instead of "qiskit.simulators".
* Add trove classifiers for the operative systems supported.
* Fix PEP8 warnings for long description.
* Avoid using __version__ in setup.py due to imports
Revert the change of using "__version__" imported from "__init__.py"
directly on "setup.py", as the current importing of the modules from
"__init__.py" causes the building to fail due to the dependencies not
being available at the time of invocation.
Add a "deploy" target to travis that builds the sphinx documentation
and push it to the github pages repository on pushes to the "stable"
branch. A custom script is used that performs the steps (clone the
repository, build the dock, commit the changes, push back) instead of
other solutions (travis-sphinx or travis github pages integration) due
to lacking the features needed for the current setup (pushing to a
specific directory on another repository preserving history).