Skip to content

Commit

Permalink
Merge pull request #74 from nschloe/flit
Browse files Browse the repository at this point in the history
Flit
  • Loading branch information
nschloe authored Jan 17, 2022
2 parents f6d6855 + 5a7aa61 commit 9283897
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 56 deletions.
17 changes: 4 additions & 13 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
version := `python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['version'])"`
name := `python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['name'])"`

version := `python3 -c "from src.pytest_codeblocks.__about__ import __version__; print(__version__)"`

default:
@echo "\"just publish\"?"

tag:
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "v{{version}}"}' https://api.github.com/repos/nschloe/{{name}}/releases

upload: clean
publish:
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
# https://stackoverflow.com/a/58756491/353337
python3 -m build --sdist --wheel .
twine upload dist/*

publish: tag upload
gh release create "v{{version}}"
flit publish

clean:
@find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
Expand Down
37 changes: 35 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[tool.isort]
profile = "black"

[project]
name = "pytest_codeblocks"
authors = [{name = "Nico Schlömer", email = "nico.schloemer@gmail.com"}]
description = "Test code blocks in your READMEs"
readme = "README.md"
license = {file = "LICENSE.txt"}
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Pytest",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dynamic = ["version"]
requires-python = ">=3.7"
dependencies = [
"pytest >= 6"
]

[project.urls]
Code = "https://github.com/nschloe/pytest-codeblocks"
Issues = "https://github.com/nschloe/pytest-codeblocks/issues"
Funding = "https://github.com/sponsors/nschloe"

[project.entry-points.pytest11]
codeblocks = "pytest_codeblocks.plugin"
41 changes: 0 additions & 41 deletions setup.cfg

This file was deleted.

1 change: 1 addition & 0 deletions src/pytest_codeblocks/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.13.0"
2 changes: 2 additions & 0 deletions src/pytest_codeblocks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from . import plugin
from .__about__ import __version__
from .main import CodeBlock, extract_from_buffer, extract_from_file

__all__ = [
"CodeBlock",
"extract_from_buffer",
"extract_from_file",
"plugin",
"__version__",
]

0 comments on commit 9283897

Please sign in to comment.