Skip to content

Conversation

@fermezz
Copy link

@fermezz fermezz commented Aug 29, 2019

Solves #757 by generating a _version.py file with setuptools_scm. I think using post-release as version-scheme is good because it lets you know the current version of the project, without doing anything more than splitting a string. Feedback is appreciated!

@codecov-io
Copy link

codecov-io commented Aug 29, 2019

Codecov Report

Merging #758 into master will increase coverage by 0.2%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #758     +/-   ##
=========================================
+ Coverage    98.1%   98.31%   +0.2%     
=========================================
  Files          32       34      +2     
  Lines        1902     2016    +114     
  Branches      149      152      +3     
=========================================
+ Hits         1866     1982    +116     
  Misses         23       23             
+ Partials       13       11      -2
Impacted Files Coverage Δ
pytest_django/__init__.py 100% <100%> (ø)
pytest_django/live_server_helper.py 96.72% <0%> (-0.16%) ⬇️
tests/test_urls.py 100% <0%> (ø) ⬆️
tests/test_unittest.py 100% <0%> (ø) ⬆️
tests/test_django_configurations.py 100% <0%> (ø) ⬆️
tests/test_db_setup.py 100% <0%> (ø) ⬆️
tests/conftest.py 100% <0%> (ø) ⬆️
pytest_django_test/compat.py 100% <0%> (ø) ⬆️
pytest_django_test/urls_overridden.py 100% <0%> (ø) ⬆️
pytest_django_test/urls.py 100% <0%> (ø) ⬆️
... and 10 more

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 d2973e2...e433801. Read the comment docs.

@blueyed
Copy link
Contributor

blueyed commented Aug 29, 2019

I'd rather recommend using https://github.com/zsimic/setupmeta/.

@fermezz
Copy link
Author

fermezz commented Aug 30, 2019

Ok nice! I was not aware of the setupmeta project. I have added a __version__ attribute under pytest_django/__init__.py which matches what should be the version of this project if this is squashed and merged (3.5.1.post2 3.5.1 which translates to 3.5.1.post2 when doing python setup.py explain). We can now have a workflow which would look like this for tagging a new version:

(pytest-django) [fermezz@thinkpad pytest-django]$ python setup.py version --bump patch --commit
  running version
  Not pushing bump, use --push to push
  Running: git add pytest_django/__init__.py
  Running: git commit -m "Version 3.5.2"
  [master 92eda6e] Version 3.5.2
   1 file changed, 1 insertion(+), 1 deletion(-)
  Running: git tag -a v3.5.2 -m "Version 3.5.2"
  (pytest-django) [fermezz@thinkpad pytest-django]$ cat pytest_django/__init__.py
  __version__ = '3.5.2'

and we can get the version of the project as simple as import pytest_django; pytest_django.__version__ which is great.

I didn't feel like it was necessary to put constraints to the version of setupmeta but if you think otherwise let me know!

@fermezz
Copy link
Author

fermezz commented Sep 4, 2019

@blueyed ping for awareness! :)

@blueyed
Copy link
Contributor

blueyed commented Jan 7, 2020

@fermezz
Sorry for late reply, and thanks for this!

I'm not too sure about setupmeta anymore given that setuptools-scm is used already.

Also pytest-django-3.7.1.dev3+g2bb0135 (master) looks better than pytest-django-3.7.0.post4 (your cherry-picked PR), so it should use versioning=devcommit (resulting in 3.7.1.dev4-g64fd5d6-dirty).

I'll leave this open for now (and can amend/change it to "devcommit" myself of course).

What do you think?

@fermezz
Copy link
Author

fermezz commented Jan 9, 2020

Totally fine, @blueyed! I can take on that tomorrow, or the day after :)

@fermezz
Copy link
Author

fermezz commented Jan 10, 2020

@blueyed Ok, so I went ahead and changed the versioning to devcommit. It's not as-straightforward to have that same versioning scheme with setuptools-scm and I don't see a big issue on changing it, but if you have a strong opinion on that, please let me know!

@blueyed
Copy link
Contributor

blueyed commented Jan 10, 2020

@fermezz
I've meant to keep using setuptools-scm more likely, but am still not sure.

What's your motiviation btw to have the version there?
(found it: #757 (comment))

@bluetech
Copy link
Member

bluetech commented Oct 9, 2020

Done as part of #880.

@bluetech bluetech closed this Oct 9, 2020
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.

4 participants