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

Fix CI and semantic-release #46

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ stages:
- test
- name: deploy
# require the branch name to be master (note for PRs this is the base branch name)
# semantic-release currently only works on master
if: branch = master

sudo: false
Expand All @@ -10,17 +11,20 @@ python:
- "3.4"
- "3.5"
- "3.6"
install: pip install tox-travis
- "3.7"
dist: xenial

install: pip install -r requirements/dev.txt
script: tox

jobs:
include:
- stage: deploy
python: 3.4
env:
- FOO=foo
# use just ONE of the tested versions for deploy
# and pick a version that has no issues
python: 3.6
script:
- git config --global user.name "semantic-release (via TravisCI)"
- git config --global user.email "semantic-release@travis"
- pip install python-semantic-release
- pip install --upgrade -r requirements/publish.txt
- semantic-release publish
Binary file removed dev-requirements.txt
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd Trade-Dangerous
python3 -m venv venv
. venv/bin/activate
pip3 install -e .
pip3 install -r dev-requirements.txt
pip3 install -r requirements/dev.txt
```

__Windows__
Expand All @@ -21,7 +21,7 @@ cd Trade-Dangerous
python3 -m venv venv
.\venv\Scripts\activate
pip3 install -e .
pip3 install -r dev-requirements.txt
pip3 install -r requirements/dev.txt
```

## Generate Documentation
Expand Down
5 changes: 5 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
m2r==0.2.1
pytest==4.1.0
Sphinx==1.8.3
tox==3.6.1
tox-travis==0.11
3 changes: 3 additions & 0 deletions requirements/publish.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r dev.txt

python-semantic-release
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ test=pytest

[semantic_release]
version_variable=tradedangerous/version.py:__version__
upload_to_pypi=false
upload_to_pypi=true
commit_message=New version by CI
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
except ImportError:
pass

with open("README.md", "r") as fh:
long_description = fh.read()

package = "tradedangerous"

exec(open("tradedangerous/version.py").read()) #pylint: disable=W0122
Expand All @@ -37,12 +40,13 @@
author="eyeonus",
author_email="[email protected]",
description="Trade-Dangerous is set of powerful trading tools for Elite Dangerous, organized around one of the most powerful trade run optimizers available.",
long_description=long_description,
long_description_content_type="text/markdown",
keywords=["trade", "elite", "elite-dangerous"],
classifiers=[
"Intended Audience :: Developers",
"Programming Language :: Python :: 3"
"Programming Language :: Python :: 3.5"
"Programming Language :: Python :: 3.6"
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
license="MPL",
test_suite="tests",
Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def pytest_collection_modifyitems(config, items):
# --runslow given in cli: do not skip slow tests
return
skip_slow = pytest.mark.skip(reason="need --runslow option to run")
skip_superslow = pytest.mark.skip(reason="need --runsuperslow option to run")
for item in items:
if "slow" in item.keywords:
item.add_marker(skip_slow)
if "superslow" in item.keywords:
item.add_marker(skip_superslow)
4 changes: 2 additions & 2 deletions tests/test_trade.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_market(self, capsys):
assert "Hydrogen Fuel" in captured.out
assert "Water 323" in captured.out


@pytest.mark.slow
def test_import_edcd(self, capsys):
#trade import -P=edcd --opt=commodity
trade([PROG, "import", "-P=edcd", "--opt=commodity"])
Expand All @@ -94,7 +94,7 @@ def test_import_edcd(self, capsys):
assert "NOTE: Nothing had to be done" in captured.out
assert regex_findin(r"NOTE: Found \d+ item\(s\)", captured.out)


@pytest.mark.slow
def test_import_maddavo(self, capsys):
#trade import -P maddavo -i -O use2d
trade([PROG, "import", "-P=maddavo", "-i", "--opt=use2d"])
Expand Down
5 changes: 3 additions & 2 deletions tests/test_trade_import_eddblink.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def teardown_module():

class TestTradeImportEddblink(object):

@pytest.mark.slow
def test_upgrades(self, capsys):
plug = module.ImportPlugin(tdb, tdenv)
assert module.UPGRADES == "modules.json"
Expand All @@ -29,7 +30,7 @@ def test_upgrades(self, capsys):
assert (plug.dataPath / plug.upgradesPath).is_file()


@pytest.mark.slow
@pytest.mark.superslow
def test_import_clean(self, capsys):
trade([PROG, "import", "-P=eddblink", '--opt=clean,skipvend,force'])
captured = capsys.readouterr()
Expand All @@ -39,7 +40,7 @@ def test_import_clean(self, capsys):
# print("to Here")
assert "NOTE: Import completed." in captured.out

@pytest.mark.slow
@pytest.mark.superslow
def test_import_upgrade(self, capsys):
trade([PROG, "import", "-P=eddblink", '--opt=upgrade'])
captured = capsys.readouterr()
Expand Down
2 changes: 1 addition & 1 deletion tradedangerous/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"""just keeper of current version"""

#TODO: remember to update tests when version changes
__version__ = '10.0.1'
__version__ = '9.5.5'