Installing Formic¶
Prequisites¶
Platform and dependencies:
- Formic requires Python 2.6+ or Python3.4+
- It has been tested on
- Mac OS X (Lion and Mountain Lion)
- Ubuntu 11.10 and 12.04LTS
- Windows XP, Windows 7 (Home Premium) and Windows 10.
Formic can work on any Python 2.6+ or Python 3.4+ system; if not, please contact the maintainer or file an issue.
Formic has no runtime dependencies outside the Python system libraries.
Installation options¶
There are three ways to obtain Formic shown below, in increasing difficulty and complexity. You need only pick one:
Option 1: Automated install
Simplest: use:
$ easy_install formic2
or:
$ pip install formic2
Option 2: Source install
Download the appropriate package from Formics page on the Python Package Index. This is a GZipped TAR file.
Extract the package using your preferred GZip utility.
Navigate into the extracted directory and perform the installation:
$ python setup.py install
Option 3: Check out the project
If you like, you could download the source and compile it yourself. The source is now on GitHub.
After checking out the source, navigate to the top level directory and build:
$ python setup.py install
Validating the installation¶
After installing, you should be able to execute Formic from the command line:
$ formic --version
If you downloaded the source, you can additionally run the unit tests. This requires py.test:
$ easy_install pytest
$ pytest -v test
Compiling the documentation¶
Formic uses Sphinx for documentation. The source files are in the ‘doc’ subdirectory. To build the documentation,
Ensure that formic has been installed and is visible on the path so you can start Python and import formic, eg:
$ cd /anywhere/on/filesystem $ python Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import formic >>> exit() $
Navigate to Formic’s top level directory, then:
$ sphinx-build doc htmlout
The documentation will be in the ./htmlout subdirectory.
Note
Only HTML generation has been tested.
Note
If you get errors that Sphinx cannot import Formic’s packages, you may not have installed the module correctly. Try reinstalling it, eg ‘python setup.py develop’ or ‘python setup.py install’
Changelog¶
1.0.2¶
New feature:
- Fix #2, FileSet now can contain arg casesensitive=True|False, default True on POSIX, but always False on NT.
- Fix #2, casesensitive can apply on both file-name and directory-name.
1.0.1¶
New feature:
- Add supports for both Python3 and Python2.
- Keep all the interface consistent with the 0.9beta8.
0.9beta8¶
New feature:
Added the ability to pass in the function that walks the directory path, which allows for alternate implementations or supplying a mock function that provides values completely unrelated to the OS. This is available only from the API and not from the command line:
files = ["CVS/error.py", "silly/silly1.txt", "1/2/3.py", "silly/silly3.txt", "1/2/4.py", "silly/silly3.txt"] for dir, file in FileSet(include="*.py", walk=walk_from_list(files)): print dir, file
Bug fixes:
Fixed #10: Paths like “//network/dir” caused an infinite loop
Fixed #11: Incorrect handling of globs ending “/**” and “/”. Ant Glob semantics for:
**/test/**
are that they should match “all files that have a test element in their path, including test as a filename.”
0.9beta7¶
Bug fixes:
- Fixed #4 and #6: Handles mixed case correctly on Windows
- Fixed #8: Formic fails if it starts directory traversal at any drive’s root directory on Windows
- Fixed #5: Formic had an unnecessary dependency on pkg_resources
Improvements:
- Fixed performance defect #7: Much faster searching for globs like “/a/b/**”
- Improved quickstart documentation: Explicitly mention that Formic searches from the current directory.
0.9beta6¶
- Fixed issue #2: VERSION.txt was not being correctly packaged causing problems with source and pip installation
- Fixed issue #3: Incorrect behaviour when absolute directory was “/”
- Removed Google Analytics from documentation, and improved documentation template
- Improved publishing process.
0.9beta5¶
This is a documentation and SCM release. No API changes.
- Updated documentation, changelogs and installation instructions
- Removed Google Analytics from Sphinx documentation
- Implemented Dovetail build * Added coverage, pylint and sloccount metrics generation * Added command-line sanity tests
0.9beta4¶
- Fixed issue #1: In 3de0331450c0
0.9beta3¶
API: FileSet is now a natural iterator:
fs = FileSet(include="*.py") filenames = [ filename for filename in fs ]
API:
__str__()
on Pattern and FileSet has been improved. Pattern now returns the just normalized string for the pattern (eg**/*.py
). FileSet now returns the details of the set include all the include and exclude patterns.Setup: Refactored setup.py and configuration to use only setuptools (removing distribute and setuptools_hg)
Documentation: Renamed all ReStructured Text files to .rst. Small improvements to installation instructions.
0.9beta2¶
- Refactored documentation files and locations to be more DRY:
- Sphinx documentation
- setup.py/Pypi readme
- README/INSTALL/CHANGELOG/USAGE in topmost directory
- Removed the file-based distribute depending on explicit dependency in setup.py
0.9beta¶
Date: 14 Apr 2011 First public release