Skip to content

Commit 1d8c211

Browse files
committed
Replace Travis with Actions
1 parent 3f7ad71 commit 1d8c211

File tree

10 files changed

+18
-60
lines changed

10 files changed

+18
-60
lines changed

.github/workflows/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,6 @@ jobs:
132132
with:
133133
python-version: ${{ matrix.python-version }}
134134
- name: Deploy package
135+
env:
136+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
135137
run: TASK=${{ matrix.task }} ./build.sh

CONTRIBUTING.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,13 @@ unless you want to make changes to the test config. You also mostly don't need t
152152
except to type ``./build.sh`` followed by the name of the task you want to run.
153153

154154
All of it will be checked on CI so you don't *have* to run anything locally, but you might
155-
find it useful to do so: A full Travis run takes about twenty minutes, and there's often a queue,
155+
find it useful to do so: A full CI run can take up to twenty minutes,
156156
so running a smaller set of tests locally can be helpful.
157157

158158
The build system should be "fairly" portable, but is currently only known to work on Linux or OS X. It *might* work
159-
on a BSD or on Windows with cygwin installed, but it hasn't been tried. If you try it and find it doesn't
160-
work, please do submit patches to fix that.
159+
on a BSD or on Windows with cygwin installed, but it hasn't been tried. Windows with WSL does work,
160+
as for Linux, and since OS-specific issues are rare for Hypothesis that's pretty useful.
161+
If you try it and find it doesn't work, please do submit patches to fix that.
161162

162163
Some notable commands:
163164

hypothesis-python/tests/README.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ library tests itself!
1212
The very short version
1313
======================
1414

15-
- To improve code coverage (eg because ``make check-coverage`` / the Travis
16-
build is failing), go to ``cover/``
15+
- To improve code coverage (eg because ``make check-coverage`` or CI is failing),
16+
go to ``cover/``
1717
- For longer / system / integration tests, look in ``nocover/``
1818
- For tests that require an optional dependency, look in the directory
1919
named for that dependency.
@@ -34,7 +34,7 @@ Some scenarios
3434
in ``test_direct_strategies.py``. Strategies with optional dependencies
3535
should go in ``hypothesis.extras``, and the tests in their own module
3636
(ie not in ``cover``). When you think you might be done, push and let
37-
Travis point out any failing tests or non-covered code!
37+
our CI system point out any failing tests or non-covered code!
3838

3939
**I've made some internal changes**
4040
That's not very specific - you should probably refer to the test-finding
@@ -68,6 +68,9 @@ Still here? Here's a note on what to expect in each directory.
6868
features such as ``mark.parametrize``, ``mark.skipif``, and ``raises``
6969
for other functions that are often useful when writing tests.
7070

71+
``conjecture/``
72+
As for ``cover/``, but specific to ``hypothesis.internal.conjecture``.
73+
7174
``cover/``
7275
The home of enough tests to get 100% branch coverage, as quickly as possible
7376
without compromising on test power. This can be an intimidating target,

hypothesis-python/tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def consistently_increment_time(monkeypatch):
5454
"""Rather than rely on real system time we monkey patch time.time so that
5555
it passes at a consistent rate between calls.
5656
57-
The reason for this is that when these tests run on travis, performance is
57+
The reason for this is that when these tests run in CI, their performance is
5858
extremely variable and the VM the tests are on might go to sleep for a bit,
5959
introducing arbitrary delays. This can cause a number of tests to fail
6060
flakily.

secrets.tar.enc

-10 KB
Binary file not shown.

tooling/src/hypothesistooling/__init__.py

+2-15
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def git(*args):
9797
subprocess.check_call(("git",) + args)
9898

9999

100-
TOOLING_COMMITER_NAME = "Travis CI on behalf of David R. MacIver"
100+
TOOLING_COMMITER_NAME = "CI on behalf of the Hypothesis team"
101101

102102

103103
def configure_git():
@@ -128,11 +128,6 @@ def push_tag(tagname):
128128

129129
def assert_can_release():
130130
assert not IS_PULL_REQUEST, "Cannot release from pull requests"
131-
assert has_travis_secrets(), "Cannot release without travis secure vars"
132-
133-
134-
def has_travis_secrets():
135-
return os.environ.get("TRAVIS_SECURE_ENV_VARS", None) == "true"
136131

137132

138133
def modified_files():
@@ -220,15 +215,7 @@ def decrypt_secrets():
220215
os.chmod(DEPLOY_KEY, int("0600", 8))
221216

222217

223-
IS_TRAVIS_PULL_REQUEST = os.environ.get("TRAVIS_EVENT_TYPE") == "pull_request"
224-
225-
IS_CIRCLE_PULL_REQUEST = (
226-
os.environ.get("CIRCLE_BRANCH") == "master"
227-
and os.environ.get("CI_PULL_REQUESTS", "") != ""
228-
)
229-
230-
231-
IS_PULL_REQUEST = IS_TRAVIS_PULL_REQUEST or IS_CIRCLE_PULL_REQUEST
218+
IS_PULL_REQUEST = os.environ.get("GITHUB_REF", "").startswith("refs/pull/")
232219

233220

234221
def all_projects():

tooling/src/hypothesistooling/__main__.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,10 @@ def deploy():
120120
print("Not deploying due to not being on master")
121121
sys.exit(0)
122122

123-
if not tools.has_travis_secrets():
123+
if "PYPI_TOKEN" not in os.environ:
124124
print("Running without access to secure variables, so no deployment")
125125
sys.exit(0)
126126

127-
print("Decrypting secrets")
128-
tools.decrypt_secrets()
129127
tools.configure_git()
130128

131129
for project in tools.all_projects():

tooling/src/hypothesistooling/projects/conjecturerust.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def upload_distribution():
100100
tools.assert_can_release()
101101

102102
# Yes, cargo really will only look in this file. Yes this is terrible.
103-
# This only runs on Travis, so we may be assumed to own it, but still.
103+
# This only runs in CI, so we may be assumed to own it, but still.
104104
unlink_if_present(CARGO_CREDENTIALS)
105105

106106
# symlink so that the actual secret credentials can't be leaked via the

tooling/src/hypothesistooling/projects/hypothesispython.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ def upload_distribution():
181181
"twine",
182182
"upload",
183183
"--skip-existing",
184-
"--config-file",
185-
tools.PYPIRC,
184+
"--username=__token__",
186185
os.path.join(DIST, "*"),
187186
]
188187
)
@@ -210,8 +209,6 @@ def upload_distribution():
210209
"body": changelog_body,
211210
},
212211
timeout=120, # seconds
213-
# Scoped personal access token, stored in Travis environ variable
214-
auth=("Zac-HD", os.environ["Zac_release_token"]),
215212
).raise_for_status()
216213

217214

whole-repo-tests/test_secrets.py

-30
This file was deleted.

0 commit comments

Comments
 (0)