-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add workflow to publish to pypi #62
Changes from all commits
0753ec1
014e133
fb0c49a
a71178c
5f8e1cd
b6d0123
591eaef
e64cf3d
a45f0c8
24834d0
856df71
bb0f4db
efbc8ac
6f13b4c
de601fe
431136a
b0fcc42
c0a796e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!coverage.py: This is a private format, don't read it directly!{"lines":{"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/__init__.py":[1,2,3,4,6,7,12,13,14,15,16,17],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/alternatives/__init__.py":[4],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/alternatives/wdm.py":[8,10,11,12,13,14,15,17,23,47,49,63,83,105,107,109,114,129,138,152,162,163,166,184,186,50,51,57,59,61,192,196,212,214,216,220,236,238,240,244,260,262,264,273,284,287,297,313,322,338,349,356,368,370,376,394,401],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/density_field/__init__.py":[4,5,6],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/density_field/transfer.py":[7,8,9,10,11,12,13,15,16,18,23,44,48,49,50,51,52,53,54,55,56,57,58,59,94,110,119,140,149,160,173,182,191,200,209,231,236,243,250,257,270,275,282,287,292,297,305,310,317,326],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/_internals/__init__.py":[3],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/_internals/_cache.py":[8,9,10,13,21,131,138,175,262,176,178,243,245,256,257,260,50,52,112,114,128,180,18,183,187,194,195,196,197,199,201,246,247,250,203,205,206,209,211,213,216,217,218,219,222,132,133,224,229,233,235,188,253,54,57,58,59,60,65,70,74,84,85,87,90,93,251,94,97,98,101,102,103,105,108,110,202,66,67,71,225,236,75,76,79,81],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/density_field/halofit.py":[8,9,10,11,12,13,14,17,106],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/cosmology/__init__.py":[3,4,5],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/cosmology/cosmo.py":[12,14,15,16,17,20,41,43,51,69,90,98,110,45,48,59,60,119,120,49,85,96,62,67,104,105],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/_internals/_framework.py":[3,4,5,11,23,25,27,41,56,74,88,90,93,106,112,113,133,141,152,158,184,185,29,37,38,91,98,99,100,101,103],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/cosmology/growth_factor.py":[8,10,11,12,13,14,15,17,18,20,25,28,30,35,55,56,58,66,106,122,149,165,189,190,205,207,209,216,225,271,298,299,316,318,320,337,354,380,382,383,389,391,430],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/_internals/_utils.py":[1,4,5,13],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/density_field/transfer_models.py":[6,7,8,9,11,12,13,14,16,17,19,23,26,39,41,43,47,64,82,84,86,112,139,141,157,159,161,206,233,320,326,344,346,348,380,393,395,399,478,482,494,541,554,556,564,594,620,621,623,661,684,685,687,712,713,715],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/density_field/filters.py":[4,6,7,8,9,10,11,14,57,59,65,79,95,118,141,159,193,206,220,257,272,273,299,301,305,308,311,314,322,323,349,351,354,357,360,363,367,368,399,400,402,406,409,412,417,422,425,451,452,459,461,463,477,483,489,496,503,512,515,522,528,534],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/mass_function/__init__.py":[3,4],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/mass_function/hmf.py":[6,8,9,10,11,12,13,15,16,17,18,19,20,22,25,66,70,71,72,73,74,75,76,77,78,79,100,109,118,127,141,150,169,185,194,210,219,224,232,246,251,256,261,266,271,284,289,296,328,333,349,356,407,414,421,465,479,493,514],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/mass_function/fitting_functions.py":[6,8,9,10,11,12,13,14,15,18,63,73,74,75,76,77,78,79,80,81,113,137,177,203,204,205,208,210,213,224,305,310,315,320,325,333,339,341,342,344,345,347,122,132,133,349,354,356,357,359,360,361,363,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,85,86,87,88,89,90,91,92,94,95,96,97,98,99,101,104,105,106,107,108,109,110,383,397,405,408,410,413,415,417,418,419,420,422,423,424,425,426,427,428,429,430,431,432,433,434,435,438,439,442,446,454,456,457,459,460,461,463,465,466,467,468,469,470,471,472,473,475,476,477,478,479,480,481,482,483,484,485,486,488,489,490,491,492,493,494,497,507,512,514,516,517,518,520,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,540,547,552,553,554,556,557,558,560,562,563,565,566,567,568,569,570,571,572,573,574,575,576,577,579,580,581,582,583,585,586,587,588,589,590,591,592,593,594,595,596,597,599,600,601,602,603,604,605,608,629,634,635,636,638,639,640,641,643,644,646,660,665,666,667,668,669,670,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,690,699,704,705,706,709,710,712,713,714,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,734,739,740,741,742,744,745,746,748,749,750,751,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,780,809,844,849,850,852,853,855,856,857,858,859,860,861,862,863,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,884,892,897,898,899,900,901,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,921,926,927,928,930,931,932,934,935,936,937,938,939,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,958,959,960,961,965,970,988,993,994,995,997,998,999,1001,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1042,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1083,1084,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1105,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1126,1127,1128,1129,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1216,1217,1218,1219,1220,1221,1222,1223,1224,1226,1227,1228,1229,1230,1231,1232,1233,1234,1236,1237,1238,1239,1240,1241,1242,1243,1244,1246,1247,1248,1249,1250,1251,1252,1253,1254,1256,1257,1260,1262,1307,1315,1327,1328,1329,1331,1332,1333,1335,1338,1339,1340,1341,1342,1343,1344,1345,1346,1348,1349,1350,1351,1352,1353,1354,1355,1356,1358,1359,1360,1361,1362,1363,1364,1365,1366,1368,1369,1370,1371,1372,1373,1374,1375,1376,1378,1379,1380,1381,1382,1383,1384,1385,1386,1388,1389,1390,1391,1392,1395,1396,1398,1483,1500,1510,1522,1523,1535,1536,1537,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,1551,1552,1553,1554,1556,1557,1558,1559,1563,1584,1585,1586,1587,1589,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1607,1608,1610,1611,1616,1617,1618,1620,1622,1623,1624,1625,1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1638,1639,1640,1641,1646,1647,1648,1649,1651,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1669,1670,1671,1672,1676],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/halos/__init__.py":[4],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/halos/mass_definitions.py":[5,6,7,8,9,10,13,14,15,16,17,18,19,23,36,38,55,66,86,106,110,199,200,202,205,206,208,210,216,217,219,221,227,231,233,241,242,244,246,265,326,327],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/mass_function/integrate_hmf.py":[3,4,5,6,9,10,13],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/helpers/__init__.py":[3,5],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/helpers/functional.py":[11,13,14,15,18,83,84,86,87,88,89,90,91,92,224],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/helpers/sample.py":[5,6,7,8,11,19,28,71],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/fitting/cli_tools.py":[],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/fitting/fit.py":[],"/home/steven/Documents/Projects/halos/HMF/hmf/src/hmf/fitting/__init__.py":[]}} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
name: Bump version | ||
name: Bump Version and Deploy | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
bump-version-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Bump version and push tag | ||
uses: mathieudutour/github-tag-action@v4.2 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
github_token: ${{ secrets.bump_version }} | ||
default_bump: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build-n-publish: | ||
name: To PyPI and TestPyPI | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@master | ||
# https://github.com/ansible/pylibssh/blob/1e7b17f/.github/workflows/build-test-n-publish.yml#L146-L151 | ||
- name: Get history and tags for SCM versioning to work | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
git describe --tags | ||
git describe --tags $(git rev-list --tags --max-count=1) | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
Comment on lines
+21
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI this action is already v2. |
||
with: | ||
python-version: 3.7 | ||
- name: Install pep517 | ||
run: | | ||
python -m pip install pep517 --user | ||
python setup.py --version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could also be |
||
- name: Build a binary wheel and a source tarball | ||
run: python -m pep517.build --binary --source --out-dir dist . | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.pypi_password }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Deploy to Test PyPI | ||
|
||
on: push | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Deploy | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@master | ||
# https://github.com/ansible/pylibssh/blob/1e7b17f/.github/workflows/build-test-n-publish.yml#L146-L151 | ||
- name: Get history and tags for SCM versioning to work | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
git describe --tags | ||
git describe --tags $(git rev-list --tags --max-count=1) | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Install pep517 | ||
run: | | ||
python -m pip install pep517 --user | ||
python setup.py --version | ||
- name: Build a binary wheel and a source tarball | ||
run: python -m pep517.build --binary --source --out-dir dist . | ||
- name: Publish distribution 📦 to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.test_pypi_password }} | ||
repository_url: https://test.pypi.org/legacy/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,13 @@ repos: | |
rev: '3.8.1' # pick a git hash / tag to point to | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-rst-docstrings | ||
- repo: https://github.com/psf/black | ||
rev: 19.10b0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.5.1 | ||
hooks: | ||
- id: rst-backticks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI you may also like this hook that Anthony has: https://github.com/asottile/setup-cfg-fmt#as-a-pre-commit-hook |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,6 @@ | ||||||||
[build-system] | ||||||||
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup. I found that 🤦 Thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The thing is that some frontends (like pip) implement a fallback and set it to |
||||||||
build-backend = "setuptools.build_meta" | ||||||||
|
||||||||
[tool.setuptools_scm] | ||||||||
local_scheme = "no-local-version" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import sys | |
import os | ||
import traceback | ||
|
||
import hmf | ||
from src import hmf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks wrong... |
||
import numpy as np | ||
from argparse import ArgumentParser | ||
from argparse import RawDescriptionHelpFormatter | ||
|
@@ -101,7 +101,7 @@ USAGE | |
help="the mass range and intervals, min max step [default: %s %s %s]" % | ||
(np.log10(h.M[0]), np.log10(h.M[-1]), np.log10(h.M[1]) - np.log10(h.M[0]))) | ||
hmfargs.add_argument("--mf-fit", nargs="*", choices=hmf.Fits.mf_fits + ["all"], | ||
help="fitting function(s) to use. 'all' uses all of them [default: %s]" % h.mf_fit) | ||
help="fitting function(s) to use. 'all' uses all of them [default: %s]" % h.mf_fit) | ||
hmfargs.add_argument("--delta-h", nargs="*", type=float, | ||
help="overdensity of halo w.r.t delta_wrt [default %s]" % h.delta_wrt) | ||
hmfargs.add_argument("--delta-wrt", choices=["mean", "crit"], | ||
|
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.
You should add such files to gitignore instead of comitting.