-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
35 lines (30 loc) · 1011 Bytes
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
language: python
dist: bionic # Use Ubuntu 18.04 (Bionic) distribution for compatibility
# Define the Python versions to test against
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
# Cache Poetry and pip dependencies to speed up builds
cache:
pip: true
directories:
- $HOME/.cache/pypoetry
# Install dependencies before running the tests
install:
- curl -sSL https://install.python-poetry.org | python3 - # Install Poetry
- poetry install # Install dependencies using Poetry
# Run the tests with tox for each Python version
script:
- poetry run tox
# Deploy to PyPI on successful builds for tagged commits
deploy:
provider: pypi
username: "__token__" # Use token-based authentication for PyPI
password:
secure: "<YOUR ENCRYPTED TOKEN HERE>" # Use Travis CLI to encrypt your token
on:
tags: true # Only deploy when a tag is pushed
branch: main # Change to the main branch if necessary
skip_existing: true # Skip uploading if the version already exists on PyPI