-
Notifications
You must be signed in to change notification settings - Fork 16
CI polish to target 0.0.7 release #58
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
Open
psilentp
wants to merge
38
commits into
master
Choose a base branch
from
tlindsy/tox-cleanup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
db82a05
refractor: remove redundancy in ci workflow
psilentp d13be0c
feat: dev and doc requirments
psilentp 19a1fa0
doc: project badges
psilentp 8b24959
fix: licence
psilentp 334a510
chore: update test workflow name
psilentp ce0394b
chore: workflow name
psilentp cba8184
chore: test badge on master
psilentp 0684f00
chore: add black check to tox
psilentp 84da09b
fix: gh-actions syntax
psilentp f9bbbcd
fix: gh-actions syntax
psilentp f13917f
fix: gh-actions syntax
psilentp fa43cfd
chore: add security check workflow
psilentp fb082b3
chore: fix missing reference in security check
psilentp 46ff340
chore: using marketplace for soft failing checks
psilentp bb2d3d9
chore: remove artifact upload since there is no github ui to access
psilentp 7d494e6
chore: remove line comment
psilentp c982ece
chore: publish workflow
psilentp 0e1e702
fix:added ordered dict shim to svg_to_axes
psilentp 50e9fce
chore:remove test-pypy step
psilentp 4acd4b8
version bump: patch
psilentp ed31fc6
Revert "fix:added ordered dict shim to svg_to_axes"
psilentp e6011b1
Revert "chore:remove test-pypy step"
psilentp 7fc7217
chore: moved deploy to ci workflow
psilentp 79a9623
chore: switched to setuptools_scm for versionning
psilentp e1e3ab3
style: black
psilentp 771b717
chore: updated local version for test-pypi
psilentp d2e35f2
style: fixed unused import warning
psilentp 42d4f59
style: ran black on non-package python files
psilentp d69a8d9
chore: added flake8 config
psilentp 6549767
chore: added pyprojec.toml
psilentp ac532ba
fix: FigureLayout import in __init__
psilentp 7e93851
style:black
psilentp 1132c85
doc:readme
psilentp 478c726
fix:removed wheel
psilentp 5058da3
Revert "fix:removed wheel"
psilentp 6858565
chore: format dev versions for test pypi
psilentp fa6c2fc
chore: return to empty dev version string
psilentp 2cc87a5
chore: continue on error true for test-pypi
psilentp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [flake8] | ||
| exclude = .git,*site-packages* | ||
| ignore = E203, E266, E501, W503, F403, F401 | ||
| max-line-length = 89 | ||
| max-complexity = 18 | ||
| select = B,C,E,F,W,T4,B9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: Security-check | ||
|
|
||
| on: [push] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Security check - Bandit | ||
| uses: Joel-hanson/bandit-report-artifacts@V1 | ||
| with: | ||
| python_version: 3.8 | ||
| project_path: figurefirst | ||
| ignore_failure: true | ||
| - name: "Flake8 warnings" | ||
| uses: TrueBrain/actions-flake8@master | ||
| with: | ||
| path: figurefirst | ||
| only_warn: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,36 @@ | ||
| #!/usr/bin/env python | ||
| from pylab import * | ||
| from figurefirst import FigureLayout,mpl_functions | ||
| from figurefirst import FigureLayout, mpl_functions | ||
|
|
||
| # You can decorate the svg <figurefirsrt:axis> tag with mpl.axis methods. For example to call ax.axhspan(100,200,zorder=10,color ='r',alpha = 0.3) on the axis named frequency.22H05.start use the following tag: | ||
| # | ||
| # | ||
| # ``` | ||
| # <figurefirst:axis | ||
| # figurefirst:name="frequency.22H05.start" | ||
| # figurefirst:axhspan="100,200,zorder=10,color='r',alpha=.3"/> ``` | ||
| # | ||
| # | ||
| # The layout.apply_mpl_methods function will then apply the methods passing the value of the svg atribute as arguments to the mpl.axis method. | ||
|
|
||
| #Passing axis methods | ||
| # Passing axis methods | ||
| import numpy as np | ||
| layout = FigureLayout('example_axis_methods_layout.svg') | ||
|
|
||
| layout = FigureLayout("example_axis_methods_layout.svg") | ||
| layout.make_mplfigures() | ||
| layout.fig.set_facecolor('None') | ||
| layout.fig.set_facecolor("None") | ||
| for mplax in layout.axes.values(): | ||
| ax = mplax['axis'] | ||
| ax.plot(np.arange(30),np.random.rand(30),color = 'k') | ||
| mpl_functions.adjust_spines(ax,'none', | ||
| spine_locations={}, | ||
| smart_bounds=True, | ||
| xticks=None, | ||
| yticks=None, | ||
| linewidth=1) | ||
| ax.patch.set_facecolor('None') | ||
| ax = mplax["axis"] | ||
| ax.plot(np.arange(30), np.random.rand(30), color="k") | ||
| mpl_functions.adjust_spines( | ||
| ax, | ||
| "none", | ||
| spine_locations={}, | ||
| smart_bounds=True, | ||
| xticks=None, | ||
| yticks=None, | ||
| linewidth=1, | ||
| ) | ||
| ax.patch.set_facecolor("None") | ||
| layout.apply_mpl_methods() | ||
| layout.insert_figures('mpl_panel_a') | ||
| layout.write_svg('example_axis_methods_output.svg') | ||
| close('all') | ||
| layout.insert_figures("mpl_panel_a") | ||
| layout.write_svg("example_axis_methods_output.svg") | ||
| close("all") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,15 @@ | ||
| #!/usr/bin/env python | ||
| import figurefirst | ||
|
|
||
| ''' | ||
| """ | ||
| To create a templated figure, draw a rectangle, and add a figurefirst:figure tag as if you were creating another figure. | ||
| Then in addition to the figurefirst:name attribute, add a figurefirst:template attribute, | ||
| whose value should correspond to the name of the figurefirst figure you want to use as the template. | ||
| The template figure will be scaled to fill the box. | ||
| ''' | ||
| """ | ||
|
|
||
| layout = figurefirst.FigureLayout('example_figure_templating_layout.svg' ) | ||
| layout = figurefirst.FigureLayout("example_figure_templating_layout.svg") | ||
| layout.make_mplfigures() | ||
| layout.append_figure_to_layer(layout.figures['group2'], 'mpl_layer_2') | ||
| layout.append_figure_to_layer(layout.figures['group3'], 'mpl_layer_3') | ||
| layout.write_svg('example_figure_templating_output.svg') | ||
|
|
||
| layout.append_figure_to_layer(layout.figures["group2"], "mpl_layer_2") | ||
| layout.append_figure_to_layer(layout.figures["group3"], "mpl_layer_3") | ||
| layout.write_svg("example_figure_templating_output.svg") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| #!/usr/bin/env python | ||
| from pylab import * | ||
| from figurefirst import FigureLayout,mpl_functions | ||
| from figurefirst import FigureLayout, mpl_functions | ||
|
|
||
| #Group axes example | ||
| layout = FigureLayout('example_group_axes_layout.svg') | ||
| # Group axes example | ||
| layout = FigureLayout("example_group_axes_layout.svg") | ||
| layout.make_mplfigures() | ||
| layout.insert_figures() | ||
| layout.write_svg('example_group_axes_output.svg') | ||
| close('all') | ||
| layout.write_svg("example_group_axes_output.svg") | ||
| close("all") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this runs every time, will it fail a build if the same version is pushed repeatedly?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should push something like
figurefirst-0.0.6.dev{distance}. Of course given this workflow where we are hitting test-pipy with every push on any branch, there is a potential collision if two branches get pushed at the same distance.My original idea was to implement something like this:
https://github.com/scikit-hep/pyhf/tree/master/.github/workflows
Which has a separate build and publish workflow for merged branches. But as we discussed above, this might just add unnecessary complexity to the project given its size.
I've enabled continue on error for this step so that the failures in the rare cases of these collisions shouldn't keep us from pushing a release. I'm not sure it is actually necessary to set continue on error to true, but it does get rid of the annoying email updates, and we can still double check the console output before merging.