Skip to content

Commit

Permalink
Merge pull request #13 from CUNY-CL/pyproj
Browse files Browse the repository at this point in the history
Migrates to pyproject.toml
  • Loading branch information
kylebgorman authored Sep 27, 2023
2 parents 66d5d62 + 353d5bc commit abd17f5
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 99 deletions.
95 changes: 63 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,73 @@
version: 2

workflows:
version: 2
test:
jobs:
- python3.9
- python3.10
version: 2.1

jobs:
python3.9: &template
pre-build:
description: A check that needs to be done on only one supported Python version
parameters:
command-run:
type: string
docker:
- image: python:3.9
# Use the latest Python 3.x image from CircleCI that Maxwell supports.
# See: https://circleci.com/developer/images/image/cimg/python
- image: cimg/python:3.10
#auth9
# username: $DOCKERHUB_USERNAME
# password: $DOCKERHUB_PASSWORD
steps:
- checkout
- run:
name: Install the full development requirements
working_directory: ~/project/
command: pip install --progress-bar off -r requirements.txt
command: pip install -r requirements.txt
- run:
name: Run black check
working_directory: ~/project/maxwell
command: black --line-length 79 --check .
- run:
name: Run flake8 check
working_directory: ~/project/maxwell
command: flake8 .
command: << parameters.command-run >>

build-python:
parameters:
python-version:
type: string
docker:
- image: cimg/python:<< parameters.python-version >>
#auth:
# username: $DOCKERHUB_USERNAME
# password: $DOCKERHUB_PASSWORD
steps:
- checkout
- run:
name: Build source distribution
working_directory: ~/project/
name: Build source distribution and install package from it
command: |
pip install --progress-bar off --upgrade pip setuptools
python setup.py sdist
pip install dist/`ls dist/ | grep .tar.gz`
pip install -r requirements.txt && \
python -m build && \
pip install dist/`ls dist/ | grep .whl`
- run:
name: Run tests
working_directory: ~/project/
command: python -m maxwell.tests.test_sed
python3.10:
<<: *template
docker:
- image: python:3.10
name: Show installed Python packages
command: pip list -v
- run:
name: Run python tests
command: |
pytest -vv tests --junitxml /tmp/testxml/report.xml
- store_test_results:
path: /tmp/testxml/

workflows:
version: 2
build-and-test:
jobs:
- pre-build:
name: black
command-run: black --line-length=79 --check .
- pre-build:
name: flake8
command-run: flake8 .
- pre-build:
name: twine
command-run: |
python -m build && \
twine check dist/`ls dist/ | grep .tar.gz` && \
twine check dist/`ls dist/ | grep .whl`
- build-python:
requires:
- black
- flake8
- twine
matrix:
parameters:
python-version: ["3.9", "3.10"]
1 change: 1 addition & 0 deletions maxwell/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import actions, sed, util # noqa: F401
1 change: 0 additions & 1 deletion maxwell/tests/__init__.py

This file was deleted.

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

[tool.setuptools]
include-package-data = false

[tool.setuptools.packages.find]
include = ["maxwell*"]

[project]
name = "maxwell"
version = "0.2.2.post2"
description = "Stochastic Edit Distance aligenr for string transduction"
readme = "README.md"
requires-python = "> 3.9"
license = { text = "Apache 2.0" }
authors = [
{name = "Simon Clematide"},
{name = "Peter Makarov"},
{name = "Travis Bartley"},
]
keywords = [
"computational linguistics",
"morphology",
"natural language processing",
"language",
]
dependencies = [
"numpy >= 1.20.1",
"scipy >= 1.6",
"tqdm >= 4.64.1",
]
classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Development Status :: 4 - Beta",
"Environment :: Console",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Text Processing :: Linguistic",
]


[project.scripts]
maxwell-train = "maxwell.train:main"

[project.urls]
homepage = "https://github.com/CUNY-CL/maxwell"
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
black>=22.3.0
build>=0.10.0
flake8>=3.9.2
numpy>=1.20.1
pytest>=7.4.0
scipy>=1.6
twine>=4.0.2
tqdm>=4.64.1
65 changes: 0 additions & 65 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion maxwell/tests/test_sed.py → tests/test_sed.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy

from . import actions, sed, util
from maxwell import actions, sed, util

SOURCE_ALPHA = list("abcdefg")
TARGET_ALPHA = list("fghijk")
Expand Down

0 comments on commit abd17f5

Please sign in to comment.