Skip to content

Commit

Permalink
Add Dockerfile.wheel and Makefile for packaging (#86)
Browse files Browse the repository at this point in the history
* Add Dockerfile.wheel and Makefile for packaging
* Use Artifactory 3.8 base image
* Readme: Fix typo
* Add building instructions
* Autoremove byte order mark
  • Loading branch information
Sergei Uversky authored and sp3nx0r committed Oct 19, 2021
1 parent 8a32f28 commit a822106
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
18 changes: 18 additions & 0 deletions Dockerfile.wheel
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.8-buster

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && \
apt-get install -y \
build-essential \
gperf \
software-properties-common

ENV SRC_DIR /opt/snudown
ENV WHEEL_OUTPUT_DIR /tmp/dist

RUN mkdir -p $SRC_DIR $WHEEL_OUTPUT_DIR
WORKDIR $SRC_DIR

ADD . $SRC_DIR
CMD pip3 wheel --wheel-dir=$WHEEL_OUTPUT_DIR .
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
PACKAGE := snudown
VERSION := 1.6.0
DOCKERFILE := Dockerfile.wheel

default: build run

build:
docker build \
-t $(PACKAGE):$(VERSION) \
-f $(DOCKERFILE) \
.

run:
mkdir -p dist
docker run \
--rm \
-v `pwd`/dist:/tmp/dist \
-it \
$(PACKAGE):$(VERSION)
8 changes: 4 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Snudown
Snudown
=======

`Snudown` is a reddit-specific fork of the [Sundown](http://github.com/vmg/sundown)
Expand All @@ -8,7 +8,7 @@ Markdown parser used by GitHub, with Python integration added.
Setup for development on Mac OS X
--------------------------------
1. From `~/src/snudown` run `$ python setup.py build`
2. If this is successful, there will now be a `snudown.so` file in the `/snudwon/build/lib.< os info >-< python version number>` directory
2. If this is successful, there will now be a `snudown.so` file in the `/snudown/build/lib.< os info >-< python version number>` directory
3. From within the `/lib.< os info >-< python version number>` directory, start a python interpreter
<!-- Make sure you can import snudown -->
>>> import snudown
Expand All @@ -32,8 +32,8 @@ Run `setup.py install` to install the module.

For Mac OS X:
1. Install `afl-fuzz` via homebrew: `brew install afl-fuzz`
3. You can now install the module via `python setup.py install`
4. You may also compile snudown using the Makefile directly if you so wish
2. You can now install the module via `python setup.py install`
3. You may also compile snudown using the Makefile directly if you so wish


Thanks
Expand Down

0 comments on commit a822106

Please sign in to comment.