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

Allow for defining arbitrary project version and name in configuratio… #166

Merged
merged 11 commits into from
Dec 7, 2020

Conversation

fizyk
Copy link
Contributor

@fizyk fizyk commented Nov 12, 2019

…n - close #165

This allows for the towncrier to be seamlessly used in non-python projects

@codecov-io
Copy link

codecov-io commented Nov 12, 2019

Codecov Report

Merging #166 (215a80a) into master (0df024e) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #166      +/-   ##
==========================================
+ Coverage   89.49%   89.59%   +0.09%     
==========================================
  Files          11       11              
  Lines         438      442       +4     
  Branches       87       89       +2     
==========================================
+ Hits          392      396       +4     
  Misses         25       25              
  Partials       21       21              
Impacted Files Coverage Δ
src/towncrier/_settings.py 95.94% <ø> (ø)
src/towncrier/build.py 89.87% <100.00%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a651d17...7adc1d6. Read the comment docs.

@tjanez
Copy link
Contributor

tjanez commented Dec 20, 2019

We've successfully cherry-picked the changes in this PR to Oasis Labs' towncrier fork and used it with the Oasis Core repo, which is a Go & Rust project.

Copy link
Member

@altendky altendky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs a catch up. Anyways, thanks for the work. Sorry I went and duplicated it, though that made the review easy since they were so close. :] I can't merge anything right now but I'll try to get that fixed so we can get this integrated once we work through the minor tidbits. My apologies it has taken so long to even get any feedback.

Comment on lines 147 to 148
"project_version": config.get("project_version"),
"project_name": config.get("project_name"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the names in the configuration file need the project_ prefix? Or would name and version suffice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a matter of preference, and short version is as good as longer. One does not use library_version or library_name variables after all...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although comming back, I used the project_ prefixes since I was extending the use of already existing variables in code

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I saw the code used longer names and that makes sense to me. I couldn't make up my mind so I thought about setuptools and checked Poetry and both of them use just name and version. I don't think it ends up being ambiguous. I don't feel strongly enough to push hard on this, but if you are comfortable with changing to the shorter, I think that's a touch more straightforward. Take your pick and we'll move on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, changed to shorter

.gitignore Show resolved Hide resolved
src/towncrier/newsfragments/165.feature.rst Outdated Show resolved Hide resolved
…n - close twisted#165

    This allows for the towncrier to be seamlessly used in non-python projects
@fizyk fizyk force-pushed the allow_for_non_python_projects branch from 2a1e0b0 to 9957da2 Compare November 25, 2020 21:49
Co-authored-by: Kyle Altendorf <sda@fstab.net>
Copy link
Member

@altendky altendky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started looking through the readme and found a few other references to 'version' that seemed like they could use some updating to account for this new feature.

So I just realized that this also introduces the possibility of specifying the version and the name via both the command line options and the configuration file. I think that other options, at least on the build command, can't do that. I vaguely feel like perhaps the CLI options should go away, though there would be a deprecation period for that. Let's just ignore that for now.
It can be handled in a separate PR if needed. But, it would probably be good to add tests that confirm the priority of the command line over the configuration file.

With all this time since you submitted this, I'm glad you are available to get it worked through and finished up quickly. :] I'm sorry I keep finding tidbits. I'm still on the newer side of review and appreciate your patience.

README.rst Outdated Show resolved Hide resolved
Comment on lines 147 to 148
"project_version": config.get("project_version"),
"project_name": config.get("project_name"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I saw the code used longer names and that makes sense to me. I couldn't make up my mind so I thought about setuptools and checked Poetry and both of them use just name and version. I don't think it ends up being ambiguous. I don't feel strongly enough to push hard on this, but if you are comfortable with changing to the shorter, I think that's a touch more straightforward. Take your pick and we'll move on.

README.rst Show resolved Hide resolved
@fizyk
Copy link
Contributor Author

fizyk commented Nov 26, 2020

Also, I'd gladly squash commits and rework commit message if that'd be something you want.

@altendky
Copy link
Member

My personal preference is to never change public history, so no need to go squashing etc for my sake.

@fizyk fizyk requested a review from altendky November 27, 2020 12:28
Copy link
Member

@altendky altendky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a few references to 'version' in the readme that will mislead people into thinking there isn't a new option for specifying it. If you would rather, I could go through that. Just let me know.

README.rst Show resolved Hide resolved
Copy link
Member

@altendky altendky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also see ClearcodeHQ#2 since GitHub didn't let me add a suggestion for a line not already in the diff context.

I think maybe that's it.

src/towncrier/newsfragments/165.feature.rst Outdated Show resolved Hide resolved
@fizyk fizyk mentioned this pull request Dec 2, 2020
@fizyk fizyk requested a review from altendky December 2, 2020 09:33
@altendky
Copy link
Member

altendky commented Dec 2, 2020

@fizyk looks like you lost most of the changes in the readme. 215a80a

    Co-authored-by: Kyle Altendorf <sda@fstab.net>
@fizyk fizyk force-pushed the allow_for_non_python_projects branch from 215a80a to 833c8cf Compare December 2, 2020 22:09
@fizyk
Copy link
Contributor Author

fizyk commented Dec 2, 2020

@fizyk looks like you lost most of the changes in the readme. 215a80a

🤦🏻‍♂️ fixed it

@altendky
Copy link
Member

altendky commented Dec 7, 2020

@fizyk, sorry for the delay here. Looks good to me. I've got the CI fixed up properly now so I'm going to go ahead and update the branch here from master. Hopefully that'll just work and I'll merge this but I wanted to give you a heads up so you don't go trying to push new work without pulling and get a surprise.

@altendky altendky merged commit 441ef3f into twisted:master Dec 7, 2020
@fizyk
Copy link
Contributor Author

fizyk commented Dec 7, 2020

@altendky thank you!

@fizyk fizyk deleted the allow_for_non_python_projects branch December 7, 2020 09:31
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

Successfully merging this pull request may close these issues.

Ability to use towncrier in non-python project
4 participants