This document describes how to work with the source code both for the generic CodecMapper and the Python ebcdic package.
To work with the source code, clone the repository:
$ git clone https://github.com/roskakori/CodecMapper.gitTo build and run CodecMapper, you need:
- Java 1.7 or later
- ant 1.8 or later, available from https://ant.apache.org/.
It might also work with earlier versions of ant, but this has not been tested.
To build CodecMapper, run:
$ ant distTo generate a mapping file for a specific codec run, for example:
$ java -jar dist/CodecMapper.jar iso-8859-15The resulting mapping file is stored in iso-8859-15.txt. The generated mapping files are located in the same folder and have names like iso-8859.15.mapping.
As an example usage, CodecMapper includes the Python ebcdic package, which is located in the ebcdic folder. For general information about this package, take a look at the ebcdic/README.
Install uv.
Then set up the pre-commit hooks that will lint the source code before a git commit:
uv run pre-commit installTo build the Python codecs and run the tests:
$ ant testAfter that, the build artifacts are located in ebcdic/dist.
To add another 8-bit EBCDIC codec, extend the ant target ebcdic in build.xml using a line like:
<arg value="cpXXX" />Replace XXX by the number of the 8-bit code page you want to include.
Then run:
ant testto build and test the distribution.
Bump version number:
-
Possibly update copyright year in:
ebcdic/__init__.py,ebcdic/README.md,LICENSE.txt, andREADME.md.
-
Edit
ebcdic/_version.py:__version__. -
Describe changes in
CHANGES.md.
Upload a release to PyPI:
$ git checkout master
$ git pull
$ ant test
$ cd ebcdic
$ rm -rf dist
$ uv build
$ uv publishUpdate production branch:
$ git checkout production
$ git merge master
$ git pushTag a release:
$ git tag --annotate --message "Tag version 2.x.x" v2.x.x
$ git push --tagsFinally, add the GitHub release.