Commit 089b2af4 authored by Josh Smith's avatar Josh Smith

Refactored project such that top level hdlmake directory is now a package. Added…

Refactored project such that top level hdlmake directory is now a package. Added setup.py for easy packaging of project with setuptools. Note that installation instructions (and how to run hdlmake) has changed!

Related changes:
- hdlmake/_version.py file now exists as a single location to manage the version of hdlmake. This is used by Sphinx docs, setup.py, and hdlmake itself.
- Cleaned up some circular dependencies in hdlmake.fetch package. This changed the design of backend_factory such that it no longer depends on importing git/svn fetchers.
- Added tests/run_tests.py. Right now it has one test which iterates through all of the top level sim and syn Manifest files and attempts to run hdlmake against them. This acts as a crude regression test.
- Added ez_setup.py. This installs setuptools if it is not available in the python environment. This guarantees that setup.py will work.
- Added Manifest.in. This lists non-hdlmake application data that should be included in a source distribution (documentation, test files, etc)
- Updated Sphinx docs to agree with the new package/module structure (with hdlmake as a top level package). Note that the installation instructions have changed.

Stealth changes:
- hdlmake now will return a non-zero exit code when an exception is caught at the top level. Previously the exception was caught and hdlmake exited with 0 exit code. This was confusing because it actually was a failure.
- Fixed a small bug in synthesis_project.py where version_key may not exist in env dictionary, causing an exception, instead of printing the helpful error message.

Rationale:
- Packages are the means of sharing Python code. The whole application should be bundled in a package.
- Easier distribution of project via setuptools
- Installation via setup.py / setuptools automatically creates executable hdlmake script
- Utilizing setuptools allows for possibility of distributing releases via PyPI.
- Possible to import from any module in hdlmake for purposes of unit testing without sys.path hacking.
parent 8cd9c99c
......@@ -8,4 +8,10 @@ hdlmake.log
*.swap
*.odt
*.orig
.svn
\ No newline at end of file
*.pyc
*.egg-info/
.svn
/pyenv/
/cyg_pyenv/
docs/_build
dist/
include COPYING
include ez_setup.py
recursive-include docs *
recursive-include scripts *
recursive-include tests *
prune docs/_build
......@@ -52,10 +52,18 @@ copyright = u'2013-2015, CERN'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.1'
# Hook the common version file to get our version information
exec(open(os.path.abspath(os.path.join('..','hdlmake','_version.py'))).read())
try:
__version__
except Exception:
__version__ = '0.0' # default if for some reason the exec did not work
version = __version__
# The full version, including alpha/beta/rc tags.
release = '2.1'
release = __version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......@@ -265,5 +273,5 @@ texinfo_documents = [
#texinfo_no_detailmenu = False
# Path to sources
sys.path.insert(0, os.path.abspath('../hdlmake'))
sys.path.insert(0, os.path.abspath('../'))
dep_file module
===============
.. automodule:: dep_file
:members:
:undoc-members:
:show-inheritance:
dep_solver module
=================
.. automodule:: dep_solver
:members:
:undoc-members:
:show-inheritance:
dependable_file module
======================
.. automodule:: dependable_file
:members:
:undoc-members:
:show-inheritance:
env module
==========
.. automodule:: env
:members:
:undoc-members:
:show-inheritance:
global_mod module
=================
.. automodule:: global_mod
:members:
:undoc-members:
:show-inheritance:
hdlmake.action package
======================
Submodules
----------
hdlmake.action.action module
----------------------------
.. automodule:: hdlmake.action.action
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.check_condition module
-------------------------------------
.. automodule:: hdlmake.action.check_condition
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.check_manifest module
------------------------------------
.. automodule:: hdlmake.action.check_manifest
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.clean module
---------------------------
.. automodule:: hdlmake.action.clean
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.fetch module
---------------------------
.. automodule:: hdlmake.action.fetch
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.fetch_makefile module
------------------------------------
.. automodule:: hdlmake.action.fetch_makefile
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.list_files module
--------------------------------
.. automodule:: hdlmake.action.list_files
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.list_modules module
----------------------------------
.. automodule:: hdlmake.action.list_modules
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.merge_cores module
---------------------------------
.. automodule:: hdlmake.action.merge_cores
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.remote_synthesis module
--------------------------------------
.. automodule:: hdlmake.action.remote_synthesis
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.simulation module
--------------------------------
.. automodule:: hdlmake.action.simulation
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.synthesis module
-------------------------------
.. automodule:: hdlmake.action.synthesis
:members:
:undoc-members:
:show-inheritance:
hdlmake.action.synthesis_project module
---------------------------------------
.. automodule:: hdlmake.action.synthesis_project
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: hdlmake.action
:members:
:undoc-members:
:show-inheritance:
fetch package
=============
hdlmake.fetch package
=====================
Submodules
----------
fetch.backend_factory module
----------------------------
hdlmake.fetch.backend_factory module
------------------------------------
.. automodule:: fetch.backend_factory
.. automodule:: hdlmake.fetch.backend_factory
:members:
:undoc-members:
:show-inheritance:
fetch.fetcher module
--------------------
hdlmake.fetch.constants module
------------------------------
.. automodule:: hdlmake.fetch.constants
:members:
:undoc-members:
:show-inheritance:
hdlmake.fetch.fetcher module
----------------------------
.. automodule:: fetch.fetcher
.. automodule:: hdlmake.fetch.fetcher
:members:
:undoc-members:
:show-inheritance:
fetch.git module
----------------
hdlmake.fetch.git module
------------------------
.. automodule:: fetch.git
.. automodule:: hdlmake.fetch.git
:members:
:undoc-members:
:show-inheritance:
fetch.svn module
----------------
hdlmake.fetch.svn module
------------------------
.. automodule:: fetch.svn
.. automodule:: hdlmake.fetch.svn
:members:
:undoc-members:
:show-inheritance:
......@@ -40,7 +48,7 @@ fetch.svn module
Module contents
---------------
.. automodule:: fetch
.. automodule:: hdlmake.fetch
:members:
:undoc-members:
:show-inheritance:
action package
==============
hdlmake package
===============
Subpackages
-----------
.. toctree::
hdlmake.action
hdlmake.fetch
hdlmake.tools
hdlmake.util
Submodules
----------
action.action module
--------------------
hdlmake.dep_file module
-----------------------
.. automodule:: action.action
.. automodule:: hdlmake.dep_file
:members:
:undoc-members:
:show-inheritance:
action.check_condition module
-----------------------------
hdlmake.dep_solver module
-------------------------
.. automodule:: action.check_condition
.. automodule:: hdlmake.dep_solver
:members:
:undoc-members:
:show-inheritance:
action.check_manifest module
----------------------------
hdlmake.dependable_file module
------------------------------
.. automodule:: action.check_manifest
.. automodule:: hdlmake.dependable_file
:members:
:undoc-members:
:show-inheritance:
action.clean module
-------------------
hdlmake.env module
------------------
.. automodule:: action.clean
.. automodule:: hdlmake.env
:members:
:undoc-members:
:show-inheritance:
action.fetch module
-------------------
hdlmake.global_mod module
-------------------------
.. automodule:: action.fetch
.. automodule:: hdlmake.global_mod
:members:
:undoc-members:
:show-inheritance:
action.fetch_makefile module
----------------------------
hdlmake.makefile_writer module
------------------------------
.. automodule:: action.fetch_makefile
.. automodule:: hdlmake.makefile_writer
:members:
:undoc-members:
:show-inheritance:
action.list_files module
------------------------
hdlmake.manifest_parser module
------------------------------
.. automodule:: action.list_files
.. automodule:: hdlmake.manifest_parser
:members:
:undoc-members:
:show-inheritance:
action.list_modules module
--------------------------
hdlmake.module module
---------------------
.. automodule:: action.list_modules
.. automodule:: hdlmake.module
:members:
:undoc-members:
:show-inheritance:
action.merge_cores module
-------------------------
hdlmake.module_pool module
--------------------------
.. automodule:: action.merge_cores
.. automodule:: hdlmake.module_pool
:members:
:undoc-members:
:show-inheritance:
action.remote_synthesis module
------------------------------
hdlmake.new_dep_solver module
-----------------------------
.. automodule:: action.remote_synthesis
.. automodule:: hdlmake.new_dep_solver
:members:
:undoc-members:
:show-inheritance:
action.simulation module
------------------------
hdlmake.srcfile module
----------------------
.. automodule:: action.simulation
.. automodule:: hdlmake.srcfile
:members:
:undoc-members:
:show-inheritance:
action.synthesis module
-----------------------
hdlmake.vhdl_parser module
--------------------------
.. automodule:: action.synthesis
.. automodule:: hdlmake.vhdl_parser
:members:
:undoc-members:
:show-inheritance:
action.synthesis_project module
-------------------------------
hdlmake.vlog_parser module
--------------------------
.. automodule:: action.synthesis_project
.. automodule:: hdlmake.vlog_parser
:members:
:undoc-members:
:show-inheritance:
......@@ -112,7 +122,7 @@ action.synthesis_project module
Module contents
---------------
.. automodule:: action
.. automodule:: hdlmake
:members:
:undoc-members:
:show-inheritance:
tools.planahead package
=======================
hdlmake.tools.aldec package
===========================
Submodules
----------
tools.planahead.planahead module
hdlmake.tools.aldec.aldec module
--------------------------------
.. automodule:: tools.planahead.planahead
.. automodule:: hdlmake.tools.aldec.aldec
:members:
:undoc-members:
:show-inheritance:
......@@ -16,7 +16,7 @@ tools.planahead.planahead module
Module contents
---------------
.. automodule:: tools.planahead
.. automodule:: hdlmake.tools.aldec
:members:
:undoc-members:
:show-inheritance:
hdlmake.tools.common package
============================
Submodules
----------
hdlmake.tools.common.sim_makefile_support module
------------------------------------------------
.. automodule:: hdlmake.tools.common.sim_makefile_support
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: hdlmake.tools.common
:members:
:undoc-members:
:show-inheritance:
tools.diamond package
=====================
hdlmake.tools.diamond package
=============================
Submodules
----------
tools.diamond.diamond module
----------------------------
hdlmake.tools.diamond.diamond module
------------------------------------
.. automodule:: tools.diamond.diamond
.. automodule:: hdlmake.tools.diamond.diamond
:members:
:undoc-members:
:show-inheritance:
......@@ -16,7 +16,7 @@ tools.diamond.diamond module
Module contents
---------------
.. automodule:: tools.diamond
.. automodule:: hdlmake.tools.diamond
:members:
:undoc-members:
:show-inheritance:
tools.iverilog package
======================
hdlmake.tools.ghdl package
==========================
Submodules
----------
tools.iverilog.iverilog module
hdlmake.tools.ghdl.ghdl module
------------------------------
.. automodule:: tools.iverilog.iverilog
.. automodule:: hdlmake.tools.ghdl.ghdl
:members:
:undoc-members:
:show-inheritance:
......@@ -16,7 +16,7 @@ tools.iverilog.iverilog module
Module contents
---------------
.. automodule:: tools.iverilog
.. automodule:: hdlmake.tools.ghdl
:members:
:undoc-members:
:show-inheritance:
tools.quartus package
=====================
hdlmake.tools.ise package
=========================
Submodules
----------
tools.quartus.quartus module
hdlmake.tools.ise.ise module
----------------------------
.. automodule:: tools.quartus.quartus
.. automodule:: hdlmake.tools.ise.ise
:members:
:undoc-members:
:show-inheritance:
......@@ -16,7 +16,7 @@ tools.quartus.quartus module
Module contents
---------------
.. automodule:: tools.quartus
.. automodule:: hdlmake.tools.ise
:members:
:undoc-members:
:show-inheritance:
tools.modelsim package
======================
hdlmake.tools.isim package
==========================
Submodules
----------
tools.modelsim.modelsim module
hdlmake.tools.isim.isim module
------------------------------
.. automodule:: tools.modelsim.modelsim
.. automodule:: hdlmake.tools.isim.isim
:members:
:undoc-members:
:show-inheritance:
......@@ -16,7 +16,7 @@ tools.modelsim.modelsim module
Module contents
---------------
.. automodule:: tools.modelsim
.. automodule:: hdlmake.tools.isim
:members:
:undoc-members:
:show-inheritance:
hdlmake.tools.iverilog package
==============================
Submodules
----------
hdlmake.tools.iverilog.iverilog module
--------------------------------------
.. automodule:: hdlmake.tools.iverilog.iverilog
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: hdlmake.tools.iverilog
:members:
:undoc-members:
:show-inheritance:
tools.ise package
=================
hdlmake.tools.libero package
============================
Submodules
----------
tools.ise.ise module
--------------------
hdlmake.tools.libero.libero module
----------------------------------
.. automodule:: tools.ise.ise
.. automodule:: hdlmake.tools.libero.libero
:members:
:undoc-members:
:show-inheritance:
......@@ -16,7 +16,7 @@ tools.ise.ise module
Module contents
---------------
.. automodule:: tools.ise
.. automodule:: hdlmake.tools.libero
:members:
:undoc-members:
:show-inheritance:
hdlmake.tools.modelsim package
==============================
Submodules
----------
hdlmake.tools.modelsim.modelsim module
--------------------------------------
.. automodule:: hdlmake.tools.modelsim.modelsim
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: hdlmake.tools.modelsim
:members:
:undoc-members:
:show-inheritance:
hdlmake.tools.planahead package
===============================
Submodules
----------
hdlmake.tools.planahead.planahead module
----------------------------------------
.. automodule:: hdlmake.tools.planahead.planahead
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: hdlmake.tools.planahead
:members:
:undoc-members:
:show-inheritance:
tools.ghdl package
==================
hdlmake.tools.quartus package
=============================
Submodules
----------
tools.ghdl.ghdl module
----------------------
hdlmake.tools.quartus.quartus module
------------------------------------
.. automodule:: tools.ghdl.ghdl
.. automodule:: hdlmake.tools.quartus.quartus
:members:
:undoc-members:
:show-inheritance:
......@@ -16,7 +16,7 @@ tools.ghdl.ghdl module
Module contents
---------------
.. automodule:: tools.ghdl
.. automodule:: hdlmake.tools.quartus
:members:
:undoc-members:
:show-inheritance:
hdlmake.tools.riviera package
=============================
Submodules
----------
hdlmake.tools.riviera.riviera module
------------------------------------
.. automodule:: hdlmake.tools.riviera.riviera
:members:
:undoc-members: