-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from terrierteam/package-modernization
Package modernization
- Loading branch information
Showing
9 changed files
with
280 additions
and
90 deletions.
There are no files selected for viewing
This file contains 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,27 @@ | ||
name: deploy | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
pypi: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: install-deps | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine build | ||
- name: build | ||
run: | | ||
python -m build | ||
- name: upload | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
twine upload dist/* |
This file was deleted.
Oops, something went wrong.
This file contains 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,36 @@ | ||
name: style | ||
|
||
on: | ||
push: {branches: [main]} # pushes to main | ||
pull_request: {} # all PRs | ||
|
||
jobs: | ||
ruff: | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
os: ['ubuntu-latest'] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'requirements-dev.txt') }} | ||
|
||
- name: Install Dependencies | ||
run: | | ||
pip install --upgrade -r requirements-dev.txt | ||
pip install -e . | ||
- name: Ruff | ||
run: 'ruff check --output-format=github pyterrier_t5' |
This file contains 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,55 @@ | ||
name: test | ||
|
||
on: | ||
push: {branches: [main]} # pushes to main | ||
pull_request: {} # all PRs | ||
schedule: [cron: '0 12 * * 3'] # every Wednesday at noon | ||
|
||
jobs: | ||
pytest: | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-latest'] | ||
python-version: ['3.9', '3.12'] | ||
|
||
runs-on: ${{ matrix.os }} | ||
env: | ||
runtag: ${{ matrix.os }}-${{ matrix.python-version }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ env.runtag }}-${{ hashFiles('requirements.txt', 'requirements-dev.txt') }} | ||
|
||
- name: Loading Torch models from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: /home/runner/.cache/ | ||
key: model-cache | ||
|
||
- name: Install Dependencies | ||
run: | | ||
pip install --upgrade -r requirements.txt -r requirements-dev.txt | ||
pip install -e . | ||
- name: Unit Test | ||
run: | | ||
pytest --durations=20 -p no:faulthandler --json-report --json-report-file ${{ env.runtag }}.results.json --cov pyterrier_t5 --cov-report json:${{ env.runtag }}.coverage.json tests/ | ||
- name: Report Test Results | ||
if: always() | ||
run: | | ||
printf "**Test Results**\n\n" >> $GITHUB_STEP_SUMMARY | ||
jq '.summary' ${{ env.runtag }}.results.json >> $GITHUB_STEP_SUMMARY | ||
printf "\n\n**Test Coverage**\n\n" >> $GITHUB_STEP_SUMMARY | ||
jq '.files | to_entries[] | " - `" + .key + "`: **" + .value.summary.percent_covered_display + "%**"' -r ${{ env.runtag }}.coverage.json >> $GITHUB_STEP_SUMMARY |
This file contains 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,2 +1,118 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
logs/ | ||
wheels/ | ||
*.egg-info/ | ||
.idea | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
*.res | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# mac | ||
.DS_Store | ||
|
||
#java | ||
terrier-python-helper/target/ | ||
.vscode | ||
.classpath | ||
.project | ||
terrier-python-helper/.settings | ||
*jar | ||
logs/ |
This file contains 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,34 @@ | ||
[build-system] | ||
requires = ["setuptools >= 61.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pyterrier-t5" | ||
description = "PyTerrier components for T5 ranking" | ||
requires-python = ">=3.9" | ||
authors = [ | ||
{name = "Sean MacAvaney", email = "[email protected]"}, | ||
] | ||
maintainers = [ | ||
{name = "Sean MacAvaney", email = "[email protected]"}, | ||
] | ||
readme = "README.md" | ||
classifiers = [ | ||
"Programming Language :: Python", | ||
"Operating System :: OS Independent", | ||
"Topic :: Text Processing", | ||
"Topic :: Text Processing :: Indexing", | ||
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", | ||
] | ||
dynamic = ["version", "dependencies"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "pyterrier_t5.__version__"} | ||
dependencies = {file = ["requirements.txt"]} | ||
|
||
[tool.setuptools.packages.find] | ||
exclude = ["tests"] | ||
|
||
[project.urls] | ||
Repository = "https://github.com/terrierteam/pyterrier_t5" | ||
"Bug Tracker" = "https://github.com/terrierteam/pyterrier_t5/issues" |
This file contains 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 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,5 @@ | ||
pytest | ||
pytest-subtests | ||
pytest-cov | ||
pytest-json-report | ||
ruff |
Oops, something went wrong.