Skip to content

Deploy test#348

Merged
Didou09 merged 18 commits intodevelfrom
deploy-test
Feb 7, 2020
Merged

Deploy test#348
Didou09 merged 18 commits intodevelfrom
deploy-test

Conversation

@lasofivec
Copy link
Copy Markdown
Collaborator

This PR should fix a couple of issues:

  • Issue Anaconda deployment failing #340 : The version number in tofu/version.py had to be forced by hand
    The problem came from the fact that travis checkouts the tag commit of tofu so the repository is not a specific branch but on a detached HEAD. I changed the setup.py so that it checks if it is building a travis tag version (by checking if $TRAVIS_TAG exists)

    tofu/setup.py

    Lines 168 to 169 in d16595d

    if (git_branch in deploy_branches or "TRAVIS_TAG" in os.environ):
    version_tofu = up.updateversion()

  • Issue Anaconda deployment failing #340 : Apparently the deployment was also done on test-pypi
    As I mentioned in the issue, the condition on: tags: True sets TRAVIS_BRANCH to the tag number, thus it is no longer master nor deploy-test (nor any other branch name).
    Solved this by checking to which git branch the commit hash corresponds to:

tofu/.travis.yml

Lines 64 to 65 in d16595d

- export IS_MASTER=$(git ls-remote origin | grep "$TRAVIS_COMMIT\s\+refs/heads/master$" | grep -o "master")
- export IS_DEPLOY=$(git ls-remote origin | grep "$TRAVIS_COMMIT\s\+refs/heads/deploy-test$" | grep -o "deploy-test")

and then checking the result as a condition for deployment

condition: $IS_DEPLOY = "deploy-test"

There is one caveat for this to work properly, that should still be the proper way to release (will update the documentation):
It is necessary to first push the commit and then push the tag (if you only push the tag it will not find a branch corresponding to that tag so there will be no deployment). Thus, the workflow for a release should be something similar to:

# make changes
pip install -e .[dev] # check that it builds
nosetest # check that nothing is broken
git commit -m " some commit message"
git tag -a x.y.z -m "some tag comment"
git push origin
git push --tags

@lasofivec
Copy link
Copy Markdown
Collaborator Author

If you agree with these changes, I would add them to release 1.4.2, what do you think ?

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #348 into devel will decrease coverage by 0.32%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##            devel    #348      +/-   ##
=========================================
- Coverage   40.03%   39.7%   -0.33%     
=========================================
  Files          79      81       +2     
  Lines       24128   26550    +2422     
=========================================
+ Hits         9659   10543     +884     
- Misses      14469   16007    +1538
Impacted Files Coverage Δ
tofu/version.py 100% <100%> (ø) ⬆️
tofu/imas2tofu/_core.py 0.45% <0%> (-0.22%) ⬇️
tofu/scripts/tofuplot.py 0% <0%> (ø)
tofu/scripts/tofucalc.py 0% <0%> (ø)
tofu/geom/_core.py 64.2% <0%> (+1.12%) ⬆️
tofu/geom/_plot.py 69.24% <0%> (+4.14%) ⬆️
tofu/utils.py 54.63% <0%> (+6.48%) ⬆️

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 45b1595...2af1a09. Read the comment docs.

@Didou09 Didou09 merged commit e4a1177 into devel Feb 7, 2020
@lasofivec
Copy link
Copy Markdown
Collaborator Author

is it ok with you if I try adding this to master(v 1.4.2) directly ?

@Didou09
Copy link
Copy Markdown
Member

Didou09 commented Feb 7, 2020

Since we have several PR to merge to master, I suggest we redo a release of 1.4.2 (delete the tag, retag, re-deploy) through a proper PR from devel to master.

I would just like to solve issue #346 before that, hopefully this afternoon, ok for you ?
It's not very clean (deleting tags, retagging...) but we are tuning our release worflow and it shoud get cleaner in the future.

Or, we can start now a cleaner workflow:

  • From now on when we do an important release (new major features like the volumes of sight, solid angles...) we increment the second number (1.5.0)
  • For all minor features, small improvements, debugging, we increment the third number (1.4.2 => 1.4.3)
  • So we could start this afternoon by tagging 1.4.3 instead of deleting 1.4.2

What do you think ?

@lasofivec
Copy link
Copy Markdown
Collaborator Author

Sounds good to me :)

@Didou09 Didou09 mentioned this pull request Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants