Skip to content

Packaging and other cleanup#159

Merged
alanbriolat merged 13 commits intoHackSoc:masterfrom
alanbriolat:packaging-etc
Jun 8, 2019
Merged

Packaging and other cleanup#159
alanbriolat merged 13 commits intoHackSoc:masterfrom
alanbriolat:packaging-etc

Conversation

@alanbriolat
Copy link
Copy Markdown
Member

@alanbriolat alanbriolat commented Jun 7, 2019

Overhaul and cleanup of project toolchain:

  • Refactor project layout:
    • csbot/ to src/csbot/: prevent accidental test behaviour from current directory being in sys.path
    • csbot/test/ to tests/: better separation of tests from code, don't ship tests during packaging
  • Preparation for packaging:
    • Move runtime dependencies to setup.py
  • Better testing:
    • Use tox for testing multiple Python versions
    • Update Travis CI to use tox but also still use the build matrix
    • Move coveralls.io reporting into tox.ini, triggered if coveralls "factor" is in test environment name (e.g. py36-coveralls)
  • Better docker:
    • Run as non-root user (UID and GID configurable with docker build --build-arg ...)
    • Speed up builds on Docker Hub by re-using built image for test phase
    • Make "build context" 100x smaller by using .dockerignore as a whitelist

@alanbriolat alanbriolat added the WIP label Jun 7, 2019
@alanbriolat alanbriolat marked this pull request as ready for review June 7, 2019 15:39
@alanbriolat alanbriolat deployed to development June 7, 2019 19:32 Active
Also use coveralls-python instead of python-coveralls.
@alanbriolat alanbriolat changed the title Packaging etc Packaging and other cleanup Jun 8, 2019

# Whitelist specific files
!src/**/*
!tests/**/*
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i thought we didn't want tests in the docker?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Don't want tests in a Python package (e.g. bdist_wheel), but they are deliberately in the Docker image so that tests get run inside the image as part of the Docker Hub build process. That way we have confidence that the produced image will run the bot correctly.

(There may be better ways to run tests without leaving them in the image, but I couldn't figure out a better one yet.)

@alanbriolat alanbriolat merged commit 918dd42 into HackSoc:master Jun 8, 2019
@alanbriolat alanbriolat deleted the packaging-etc branch June 25, 2019 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants