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

[IMP] Migrate to poetry to manage package #329

Closed
wants to merge 5 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
36 changes: 22 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,52 @@ cache:

matrix:
include:
- python: 2.7
# Use python 3.8 as system executable for Poetry compatibility
- python: 3.8
env:
TOXENV=pylint
- python: 3.5
PY=2.7
- python: 3.8
env:
TOXENV=pylint
PY=3.5
- python: 3.7
env:
TOXENV=pylint
PY=3.7
DEPLOY="1"
- python: 3.8
env:
TOXENV=pylint
- python: 3.9-dev
PY=3.8
- python: 3.9
env:
TOXENV=pylint
PY=3.9


install:
# Remove packages installed from addons-apt-packages of travis file
before_install:
- pip install -U pip
- sed -i '/node/d' ${TRAVIS_BUILD_DIR}/install.sh
- sed -i '/pip install ./d' ${TRAVIS_BUILD_DIR}/install.sh

install:
# Install dependencies
- ${TRAVIS_BUILD_DIR}/install.sh
- pip install poetry tox
# Use correct python version
- poetry env use ${PY}

# Install testing dependencies
- pip install coveralls flake8==3.8.3 tox restructuredtext_lint pygments
before_script:
# HACK: Pre-create venv paths. See https://github.com/python-poetry/poetry/issues/3218
- venv_path=($(poetry env list --full-path | tr " " "\n"))
- mkdir -p ${venv_path[0]}/local/lib/python${PY}/dist-packages/

script:
- flake8 --ignore=E722,F601,F841,W503,W504,W605 --max-line-length=88 --exclude=__init__.py .
- restructuredtext-lint ${TRAVIS_BUILD_DIR}/README.rst
- tox -e $TOXENV,profile-stats
- poetry run flake8 --ignore=E722,F601,F841,W503,W504,W605 --max-line-length=88 --exclude=__init__.py ./pylint_odoo
- poetry run restructuredtext-lint ${TRAVIS_BUILD_DIR}/README.rst

after_success:
- coveralls
- python setup.py sdist # Build ChangeLog file from git log
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is building the package to upload to pypi?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry. I think I saw your comment there and assumed that step only enabled the changelog generation from git, so I deleted it.

We can build and push with poetry publish

I will be adding this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can either use poetry build to build the package and use the current deploy stage to push it, or use poetry publish --build which will do both in one step. Which do you prefer @moylop260?

- poetry run coveralls
- poetry build

deploy:
skip_cleanup: true # Allow to upload Changelog generated from tox
Expand Down
4 changes: 0 additions & 4 deletions install.sh

This file was deleted.

Loading