Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ jobs:
- name: Test with pytest
run: |
pipenv run test
- name: Test package build and install
run: |
pip install .
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ Temporary Items
### VirtualEnv template
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
*/[Bb]in/
*/[Ii]nclude/
*/[Ll]ib/
*/[Ll]ib64/
*/[Ll]ocal/
*/[Ss]cripts/
pyvenv.cfg
.venv
pip-selfcheck.json
Expand Down
6 changes: 6 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ flake8 = "*"
pytest-cov = "*"
isort = "*"

# For `publish` script.
build = "*"
twine = "*"
setuptools_scm = "*"

[packages]
numpy = "*"
scikit-learn = "*"
Expand All @@ -21,3 +26,4 @@ python_version = "3.8"
isort = "isort . -c"
test = "pytest tests/test_scheme.py tests/test_reporters.py tests/test_v1.py --cov=seqeval --cov-report=term-missing -vv"
flake8 = "flake8 seqeval --ignore=F401,E741"
publish = "python scripts/publish.py"
904 changes: 735 additions & 169 deletions Pipfile.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = ["setuptools", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
25 changes: 25 additions & 0 deletions scripts/publish.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "build",
# "twine",
# ]
# ///
import glob
import itertools
import subprocess
from pathlib import Path


def publish():
subprocess.run(["pyproject-build", "."], check=True)
dists = list(
itertools.chain.from_iterable(
Path("dist").glob(dist_glob) for dist_glob in ("*.tar.gz", "*.whl")
)
)
subprocess.run(["twine", "upload"] + dists, check=True)


if __name__ == "__main__":
publish()
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
long_description = '\n' + f.read()

if sys.argv[-1] == 'publish':
os.system('python setup.py sdist bdist_wheel upload')
sys.exit()
sys.exit("After running `pipenv install --dev`, you can use `pipenv run publish` instead.")

required = ['numpy>=1.14.0', 'scikit-learn>=0.21.3']

setup(
name=NAME,
use_scm_version=True,
setup_requires=['setuptools_scm'],
description=DESCRIPTION,
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down