Skip to content

Commit

Permalink
Travis/tox/PyPI setup (Test PyPI)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmabey committed Apr 20, 2021
1 parent 473a93c commit 01ed19b
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 14 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
.vscode
*/__pycache__
.pytest_cache

dist
docs/_build/
.tox
.coverage
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,3 @@ repos:
hooks:
- id: black
language_version: python3.9
- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: poetry run pytest
language: system
pass_filenames: false
always_run: true
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
language: python
python:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
# - '3.10'
env:
global:
secure: XbEp3MFLRf7ng/DWr7GYwHF1XFdIubx5e4A4b5yyMl5SFxESQWMN7ZaVGcz2i5gZEON38zCVSMEIYYkdba3qPNVjazISXaQ6bj+QhPrcoauKOU04g4zaV4DGMqqLVntmahPYwbdhEJcuJBy5LIXO7Gxbd/DEXvYH5dsxSAisZexSVMg1y7S5iUP7i2xAisivP1UcDQNPynri0sEKOhUG7ZWSPZGAIkg1RrmaQhoaTyKhXHy/a5aKnuemzDqfhX7slnSb781h5Cgu9/DO5lHXtGTtopqM5i26A5swij9I0ef1H7cjgpAKUCQEWbUwAKVnl/rUZMIiwqZxZVzQ6lOlhuM7K8jTeYSFBbSjm5fqZhEQpK8YcFad0xW+sHEd8zuDetP76cVJ+vZ13nsNmxXR+gphXME3QF+xiYzqn852jIwU4XDTLUdIQcsbsaRRo0iP8opHQ95MpZCTcc+PqVTgKnmG70ht098ac0mpZ5nvkE8lq197IRm/KUB3nv11lNQZ/VbSicgaXnVHj/aVPtSJDArpYnelm05zUySBV9CMkdeTkdiewDmA9p+3T8TmGx0fzJT4u7fzBvqxesa9yE6rR4tuFOZn30X3Ex/cZqkF7kgibhjsV2Ky8HigCBUKLUnjD9mwHavh6AxkEh2LZlVyvnvEKd84RXGz9z++MGbKDoI=
before_install:
- pip install poetry
install:
- poetry install -v
- pip install tox-travis
script:
- tox
after_success:
- coveralls
before_deploy:
- poetry config repositories.testpypi https://test.pypi.org/simple
- poetry config http-basic.testpypi __token__ $TEST_PYPI_PW
- poetry build
deploy:
provider: script
script: poetry publish -r testpypi
on:
condition: "$TRAVIS_PYTHON_VERSION == py39"
tags: true
repo: mmabey/fhirdatetime.git
2 changes: 1 addition & 1 deletion fhirdatetime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from ._datetime import _cmp, _format_offset, _format_time

__all__ = ["DateTime", "__version__"]
__version__ = "0.1.0"
__version__ = "0.1.0-alpha.1"

DATE_FIELDS = ("year", "month", "day")
TIME_FIELDS = ("hour", "minute", "second", "microsecond")
Expand Down
125 changes: 124 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ known_third_party = ["pytest", "sphinx_rtd_theme"]

[tool.poetry]
name = "fhirdatetime"
version = "0.1.0"
description = ""
version = "0.1.0-alpha.1"
description = "A datetime-compatible class for FHIR date/datetime values."
authors = ["Mike Mabey <mike.mabey@ooda-health.com>"]

[tool.poetry.dependencies]
Expand All @@ -15,7 +15,24 @@ pytest = "^5.2"
pre-commit = "^2.12.0"
Sphinx = "^3.5.4"
sphinx-rtd-theme = "^0.5.2"
tox = "^3.23.0"
coveralls = "^3.0.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py36,py37,py38,py39,py310
skip_missing_interpreters = True
[tox:.package]
basepython = python3
[testenv]
deps = pytest
commands = pytest
"""
2 changes: 1 addition & 1 deletion tests/test_fhirdatetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

def test_version():
"""Check library version is what it should be."""
assert __version__ == "0.1.0"
assert __version__ == "0.1.0-alpha.1"


def compare_native(dt: DateTime, other: Union[date, datetime]):
Expand Down

0 comments on commit 01ed19b

Please sign in to comment.