Skip to content

Commit

Permalink
ci: A believes fix for prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethEnevoldsen committed Jan 3, 2023
1 parent 7aeca29 commit 273785c
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install ".[docs,tutorials]"
# if there is doc or tutorial requirements.txt file then install it
if [ -f ./docs/tutorials/requirements.txt ]; then
pip install -r ./docs/tutorials/requirements.txt
fi
if [ -f ./docs/requirements.txt ]; then
pip install -r ./docs/requirements.txt
fi
- name: Build and Commit
uses: sphinx-notes/[email protected]
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
name: Release
on:
# uncomment the following to only release on push to main
# this is not recommended as it will not release if the tests fail
# however it is faster and can be used for testing
push:
branches: [main]
pull_request:
branches: [main]
branches:
- main
# uncomment the following to only release on a successful workflow run
# this is recommended as it will only release if the tests pass
# this however cause you to test twice which might be not be ideal
# if you oncomment this
# workflow_run:
# workflows: ["Tests"]
# types:
# - completed

jobs:
release:
runs-on: ubuntu-latest
concurrency: release

# if the workflow run was successful and the branch is main:
# only uncomment this if you uncomment the workflow_run above
# if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/main' }}
# only uncomment this if you run on push to main
if: ${{ github.ref == 'refs/heads/main' }}
steps:
# Checkout action is required for token to persist
Expand All @@ -21,11 +35,12 @@ jobs:
- name: Python Semantic Release
uses: relekang/[email protected]
with:
git_committer_name: release-bot
github_token: ${{ secrets.RELEASE }}
# Remember to copy the [semantic_release] section from setup.cfg
# Remember to copy the [semantic_release] section from pyproject.toml
# as well
# To enable pypi,
# 1) Set upload_to_pypi to true in setup.cfg and
# 1) Set upload_to_pypi to true in pyproject.toml and
# 2) Set the pypi_token in the repo
# 3) Uncomment the two lines below
repository_username: __token__
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ jobs:
shell: bash
run: |
python -m pip install --upgrade pip
# Assumes the package have the tests extra
pip install ".[tests]"
# if there is a ./tests/requirements.txt file then install it
if [ -f ./tests/requirements.txt ]; then
pip install -r ./tests/requirements.txt
fi
- name: Run and write pytest
shell: bash
Expand All @@ -43,7 +48,13 @@ jobs:
- name: Install dependencies for notebooks
shell: bash
run: |
# Assumes the package have the tutorials extra
pip install ".[tutorials]"
# if there is a tutorials requirements.txt file then install it
if [ -f ./tests/requirements.txt ]; then
pip install -r ./docs/tutorials/requirements.txt
fi
- name: Convert and run notebooks
shell: bash
Expand Down
8 changes: 7 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ package using the following commands:
git clone https://github.com/hlasse/TextDescriptives
pip install -e ".[style,tests,docs,tutorials]"
pip install -e ".[style,tests,docs,tutorials]"
# pip install specific dependencies for each
# as not e.g. links currently can't be included in extra
# dependencies
pip install -r tests/requirements.txt
pip install -r docs/tutorials/requirements.txt
5 changes: 5 additions & 0 deletions docs/tutorials/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# only for requirements which can't be specified in the pyproject.toml file
# e.g. links to wheels which is not allowed in pyproject.toml on pypi

# spacy pipeline
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0.tar.gz
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ keywords = [
]

dependencies = [
"spacy>=3.1.0<3.5.0",
"spacy>=3.1.0,<3.5.0",
"numpy>=1.20.0,<1.24.0",
"pandas>=1.0.0,<1.6.0",
"pyphen>=0.11.0,<0.12.0",
Expand All @@ -57,8 +57,6 @@ style = [
tests = [
"pytest>=7.1.3,<7.3.0",
"pytest-cov>=3.0.0,<3.0.1",
# the @ allows installing using a link
"en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0.tar.gz",
]
docs = [
"sphinx>=5.3.0,<5.4.0",
Expand All @@ -73,7 +71,6 @@ tutorials = [
"jupyter",
"seaborn",
"matplotlib",
"en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0.tar.gz",
]

[project.readme]
Expand All @@ -91,7 +88,7 @@ name = "Apache License 2.0"
where = ["src"]

[build-system]
requires = ["setuptools"]
requires = ["setuptools>=61.0.0", "wheel", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[tool.coverage.run]
Expand Down Expand Up @@ -121,6 +118,7 @@ branch = "main"
version_variable = [
"pyproject.toml:version"
]
build_command = "python -m pip install build; python -m build"
upload_to_pypi = true
upload_to_release = true

Expand Down
4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

5 changes: 5 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# only for requirements which can't be specified in the pyproject.toml file
# e.g. links to wheels which is not allowed in pyproject.toml on pypi

# spacy pipeline
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0.tar.gz

0 comments on commit 273785c

Please sign in to comment.