-
Notifications
You must be signed in to change notification settings - Fork 265
fix: custom commit parser path loading #687
Description
Hi
R.e. custom parsers, the docs say:
As such you will need to ensure that your custom commit parser is import-able from the environment in which you are running Python Semantic Release. The string should be structured in the standard module:attr format; for example, to import the class MyCommitParser from the file custom_parser.py at the root of your repository, you should specify "commit_parser=custom_parser:MyCommitParser" in your configuration, and run the semantic-release command line interface from the root of your repository. Equally you can ensure that the module containing your parser class is installed in the same virtual environment as semantic-release.
It took a while to figure out that just specifying a repo-local parser (or jinja extension) wouldn't work without running as PYTHONPATH=. semantic-release ... or similar. I'm not sure if that's intentional or not (I can read the above both ways) so thought I'd check.
Hacking in sys.path.append(os.getcwd()) works but I assume frowned upon, though would make usage nicer. Otherwise, I wonder if an additional note in the docs about setting PYTHONPATH appropriately might be helpful for other python dimwits like myself?
Also I needed #686 to get things working.
Thanks