File tree Expand file tree Collapse file tree 5 files changed +66
-3
lines changed
Expand file tree Collapse file tree 5 files changed +66
-3
lines changed Original file line number Diff line number Diff line change 11src /interscript /maps /* .py
22__pycache__
3+ build /
4+ dist /
5+ * .egg-info
Original file line number Diff line number Diff line change @@ -35,6 +35,38 @@ interscript.load_map('bgnpcgn-ukr-Cyrl-Latn-2019')
3535print(interscript.transliterate('bgnpcgn-ukr-Cyrl-Latn-2019', input()))
3636-----
3737
38+ == Development
39+
40+ Ensure you have used a bootstrap repository https://github.com/interscript/interscript
41+ and not just cloned this repo yourself, otherwise `./setup.sh` script won\'t work.
42+
43+ `./setup.sh` script is used to build the maps from the `maps` repository using our Ruby
44+ Interscript implementation. Those maps are compiled to respective `.py` files inside
45+ `src/interscript/maps/` directory and are not included in this repository.
46+
47+ === Running tests
48+
49+ [source,shell]
50+ ---
51+ $ ./setup.sh
52+ $ pip install -e .
53+ $ pytest
54+ ---
55+
56+ === Building package
57+
58+ [source,shell]
59+ ---
60+ $ ./setup.sh
61+ $ python -m build
62+ ---
63+
64+ === Publishing package
65+
66+ [source,shell]
67+ ---
68+ $ twine publish file.whl
69+ ---
3870
3971== Copyright and license
4072
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ rm -rf src/interscript/maps
4+ mkdir -p src/interscript/maps
5+ pushd ../ruby
6+ bundle install || exit 1
7+ bundle exec rake compile[python,../python/src/interscript/maps] || exit 1
8+ popd
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ authors = [
55 { name =" Ribose Inc." , email =" open.source@ribose.com" },
66]
77description = " Interoperable script conversion systems"
8- readme = " README.adoc"
8+ readme = { file = " README.adoc" , content-type = " text/plain " }
99requires-python = " >=3.8"
1010classifiers = [
1111 " Programming Language :: Python :: 3" ,
@@ -23,5 +23,5 @@ Homepage = "https://www.interscript.org"
2323Issues = " https://github.com/interscript/interscript-python/issues"
2424
2525[build-system ]
26- requires = [" hatchling " ]
27- build-backend = " hatchling.build "
26+ requires = [" setuptools " , " wheel " , " regex " ]
27+ build-backend = " setuptools.build_meta "
Original file line number Diff line number Diff line change 1+ from setuptools import setup , find_packages
2+ from setuptools .command .build_py import build_py as _build_py
3+ import os
4+
5+ class CustomBuildCommand (_build_py ):
6+ """Ensure the maps are built"""
7+
8+ def run (self ):
9+ if not os .path .exists ("src/interscript/maps" ):
10+ print ("Maps have not been built. Please issue ./build.sh before trying to build a package." )
11+ exit (1 )
12+
13+ # Call the superclass method to perform the standard build
14+ super ().run ()
15+
16+ setup (
17+ cmdclass = {
18+ 'build_py' : CustomBuildCommand ,
19+ },
20+ )
You can’t perform that action at this time.
0 commit comments