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

Setuptools #9

Closed
wants to merge 3 commits into from
Closed

Setuptools #9

wants to merge 3 commits into from

Conversation

earthgecko
Copy link
Owner

Merge @languitar changes for setuptools and more pythonic structure that was submitted as:

Provide a setuptools-based build infrastructure #93 - etsy/skyline#91

Johannes Wienke added 3 commits June 17, 2014 18:15
This rather longish commit provides a complete build infrastructure
based on setuptools that allows to install skyline like any other python
application.

For setuptools to work correctly, a few fundamental changes had to be
made apart from minor fixes. The most fundamental changes are:

* Inside the src directory a dedicated skyline folder / package has been
  created to ensure that the skyline classes do not interfere with other
  python packages.
* The python scripts called by the bash scripts that encapsulate the
  real functionality of skyline are now generated by setuptools. For
  this to work the scripts had to be converted to real modules, which
  means that a dash in the name was not acceptable. In case anyone has used
  these scripts directly, the name has now changed. It might be possible
  to restore the behavior by adding symlinks or small bash wrapper
  scripts inside the src tree, but this isn't done so far. The general
  bash scripts in bin reflect the changed names.
* The settings.py.example has been renamed to settings.py so that
  setuptools can directly execute the unit tests without requiring user
  interaction. In the future, providing a settings.py with defaults that do
  not require any user interaction, might make skyline completely usable
  out of the box.

In detail, the following changes have been made:

* .gitignore: added stuff generated by setuptools, removed settings.py,
  which is now part of the distribution so that unit tests can execute
  without user interaction
* .travis.yml: updated to new build system. Unit tests now executed
  through setup.py. Calling nose is still posible, though
* MANIFEST.in: added a setuptools manifest to package the static files
  for the webapp
* bin/*.d: updated to new script names for in-source use. Moreover, an
  if-else branch was added to decided whether the scripts should call
  the python files directly when called inside the source tree, or the
  generated setuptools wrapper scripts in case of a real installation
* setup.cfg: contains settings for running the nose tests from within
  setuptools by calling python setup.py test
* setup.py: The real build system logic. Some values are quite empty
  still, since I do not know the correct contents. Please updated
  accordingly.
* src: moved all files to skyline package, made every folder a python
  package by adding an __ini__.py file to be discoverable by setuptools.
* src/*/*-agent.py: renamed to agent.py to have a python module name so
  that setuptools can use these modules as entry point for console
  scripts. Moreover, executed script contents were moved to a run
  function which is then callable as a setuptools entry point. Module
  main functionality has been preserved by calling the run function inside
  the main block. Several smaller content changes had to be made to
  preserve the functionality after these changes.
* src/*.py, tests/*.py: Manual changes to the pythonpath have been removed since
  with a real package structure, everything is now done automatically by
  python and for testing by the setuptools nose integration.
* webapp.py: added a route to server anomalies.json from any configured
  location to /anomalies.json. This is necessary, since users should not
  modify the contents of the installed python egg just to push the
  updated anomaly detections to a path that is served by the webserver.
* skyline.js: Fetch anomalies from /anomalies.json as described above.
  This enables the user to specify any location he wants for the
  generated json file.
* horizon/listen.py: Explicitly added the StringIO import. No idea how
  this could work before.
* utils/*.py: Updated imports to reflect new package structure
Oops, seems I missed this change for the initial commit.
@earthgecko
Copy link
Owner Author

This has been superseded by the crucible branch.

@earthgecko earthgecko closed this Jul 29, 2016
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.

1 participant