Skip to content

Commit

Permalink
Publish to pypi with poetry.
Browse files Browse the repository at this point in the history
Resolve #14.
  • Loading branch information
ryneeverett committed Sep 19, 2021
1 parent 8b073b6 commit f19335e
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 29 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
A command-line utility for pulling code blocks out of markdown files.

```sh
$ pip install -e git+https://github.com/ryneeverett/mkcodes.git#egg=mkcodes
$ pip install mkcodes

# For traditional markdown code-block support.
$ pip install markdown
$ pip install mkcodes[markdown]

$ mkcodes --help
Usage: mkcodes [OPTIONS] INPUTS...
Expand Down Expand Up @@ -33,6 +33,5 @@ Running Tests
-------------

```sh
python setup.py develop
./test
```
51 changes: 51 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[tool.poetry]
name = "mkcodes"
version = "0.1.0"
description = "A command-line utility for pulling code blocks out of markdown files."
authors = ["ryneeverett <[email protected]>"]
license = "Apache-2.0"

[tool.poetry.dependencies]
python = "^3.8"
click = "*"

Markdown = { version = "*", optional = true }

[tool.poetry.extras]
markdown = ["Markdown"]

[tool.poetry.dev-dependencies]
Markdown = "*"

[tool.poetry.scripts]
"mkcodes" = "mkcodes:main"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
10 changes: 0 additions & 10 deletions setup.py

This file was deleted.

25 changes: 9 additions & 16 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
with import <nixpkgs> {};
let
pkgs = import <nixpkgs> {};
testDependencies = [
pkgs.python3Packages.setuptools
pkgs.python3Packages.markdown
];
mkcodes = pkgs.python3Packages.buildPythonPackage {
pname = "mkcodes";
version = "master";
src = ./.;

propagatedBuildInputs = [
pkgs.python3Packages.click
];
checkInputs = testDependencies;
mkcodesEnv = poetry2nix.mkPoetryEnv {
projectDir = ./.;
# editablePackageSources = {
# mkcodes = ./mkcodes;
# };
};
in
pkgs.mkShell {
buildInputs = [
mkcodes
] ++ testDependencies;
pkgs.poetry
mkcodesEnv
];
}

0 comments on commit f19335e

Please sign in to comment.