Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make package optional #111

Closed
mauritsvanrees opened this issue Apr 10, 2018 · 1 comment
Closed

Make package optional #111

mauritsvanrees opened this issue Apr 10, 2018 · 1 comment

Comments

@mauritsvanrees
Copy link
Contributor

I am trying outtowncrier. I see that the config file requires a package entry, which is used to get the version and the name for the title_format. In my case, this should not be needed:

  • I will pass the version on the command line.
  • I have this in my config file: title_format = "{version} ({project_date})". So the package name is not shown here.

(The package name is passed to the main template as well, but by default it is not used there.)

So I would like to avoid setting the package name in the configuration, for two reasons really:

  1. Like I said above: I do not need it.
  2. towncrier fails if it cannot import the package. This assumes that the package-to-be-released is installed in the same virtualenv as towncrier, or all its dependencies have been installed, which in most cases is not true for me.

For the second reason it would help if #107 is released, so I can pass the package name on the command line. A workaround would be to cheat by putting package = "towncrier" in the configuration, which can obviously be imported. :-)

What I would like best:

  • If package is not defined in the config and not passed on the command line, use an empty string. (This may mean that the version cannot be determined automatically, but that can already be passed on the command line.)
  • If package is defined but cannot be imported, fall back to using package as the name. For Python projects, 99% of the time this will be the same anyway. (I could make this a separate issue, but it is related.)
mauritsvanrees added a commit to mauritsvanrees/towncrier that referenced this issue Apr 23, 2018
When the version is passed on the command line, and the `title_format` does not use the package name, and it is not used for the path to the news fragments, then no package name is needed, so we should not enforce it.

Closes issue twisted#111.
@hawkowl
Copy link
Member

hawkowl commented May 16, 2018

Merged! Will do a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants