Skip to content

Development

Philippe Ombredanne edited this page Jul 3, 2015 · 19 revisions

###Development### See CONTRIBUTING.rst for details: https://github.com/nexB/scancode-toolkit/blob/master/CONTRIBUTING.rst

##Tips## ###Code layout and conventions### Source code is in src/. Tests are in tests/.

There is one Python package for each major feature under src/ and a corresponding directory with the same name under tests (but this is not a package by design).

Each test script is named test_XXXX and while we love to use py.test as a test runner, these tests have no dependencies on py.test, only on the unittest module.

When source or tests need data files, we store these in a data subdirectory.

We use PEP8 conventions with a relaxed line length that can be up to 90'ish characters long when needed to keep the code clear and readable.

###pip requirements and the configure script### ScanCode use the configure/configure.bat and etc/configure.py scripts to run install a virtualenv, install pip requirements and more in a self-contained way that require no network connectivity.

Earlier unreleased versions of ScanCode where using buildout to install and configure eventually complex dependencies. We had some improvements that were merged in the upstream buildout to support bootstrapping and installing without a network connection and When we migrated to use pip and wheels as new, improved and faster way to install and configure dependencies we missed some of the features of buildout like the recipes, being able to invoke arbitrary Python or shell scripts after installing packages and have scripts or requirements that are operating system-specific.

The etc/configure.py does all this (even though not all of it used here yet).

###ScanCode requirements and third-party Python libraries### In a somewhat unconventional way, all the required libraries are vendored aka. copied in the repo itself in the thirdparty/ directory. If ScanCode were only a library if would not make sense. But its is first an application and having a well defined frozen set of dependencies is important for apps. The benefit of this approach (combined with the configure script) means that a mere checkout of the repository contains everything needed to run ScanCode except for a Python interpreter.

###Using ScanCode as a Python library### ScanCode can be used alright as a Python library .. BUT even though scancode-toolkit can be built as a Python wheel, all its dependencies are not yet available as in Pypi. You will have to wait for this (or help with the packaging of missing Pypi dependencies).

These missing Pypi dependencies either where never published on Pypi by their respective upstream authors or have some advanced patches and bug fixes not yet available as a release on Pypi). Until

###To cut a release:###

  • bump the version in:
  • src/scancode/__init__.py
  • setup.py
  • Update the CHANGELOG.rst
  • merge develop branch in master and tag the release.
  • draft a new release in GitHub, using the previous release blurb as a base. Highlight new and noteworthy changes from the CHANGELOG.rst.
  • run etc/release/release.sh locally.
  • upload the release archives created in the dist/ directory to the GitHub release page.
  • save the release as a draft.
  • test the downloads.
  • publish the release.
Clone this wiki locally