summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-11 21:48:53 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-11 21:48:53 +0000
commitd0b285620e4f194b190e818bdb03fa165d533441 (patch)
treed57d2e3442c6d8cd7b4e72fad87bf9bb306ec8a1
parentf1b7f65cd121215920f74fcce8ef438f7c076d55 (diff)
automatic import of python-dockerfile
-rw-r--r--.gitignore1
-rw-r--r--python-dockerfile.spec219
-rw-r--r--sources1
3 files changed, 221 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..c11b637 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/dockerfile-3.2.0.tar.gz
diff --git a/python-dockerfile.spec b/python-dockerfile.spec
new file mode 100644
index 0000000..3b6b5b1
--- /dev/null
+++ b/python-dockerfile.spec
@@ -0,0 +1,219 @@
+%global _empty_manifest_terminate_build 0
+Name: python-dockerfile
+Version: 3.2.0
+Release: 1
+Summary: Parse a dockerfile into a high-level representation using the official go parser.
+License: MIT
+URL: https://github.com/asottile/dockerfile
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/6e/75/1395fac29bd2dcccb51ffae11ba9a19fe159eabf9596bca4cf49c1a2b191/dockerfile-3.2.0.tar.gz
+BuildArch: noarch
+
+
+%description
+The goal of this repository is to provide a wrapper around
+[docker/docker](https://github.com/docker/docker)'s parser for dockerfiles.
+## python library
+### Installation
+This project uses [setuptools-golang](https://github.com/asottile/setuptools-golang)
+when built from source. To build from source you'll need a go compiler.
+If you're using linux and sufficiently new pip (>=8.1) you should be able to
+just download prebuilt manylinux1 wheels.
+```
+pip install dockerfile
+```
+### Usage
+There's three api functions provided by this library:
+#### `dockerfile.all_cmds()`
+List all of the known dockerfile cmds.
+```python
+>>> dockerfile.all_cmds()
+('add', 'arg', 'cmd', 'copy', 'entrypoint', 'env', 'expose', 'from', 'healthcheck', 'label', 'maintainer', 'onbuild', 'run', 'shell', 'stopsignal', 'user', 'volume', 'workdir')
+```
+#### `dockerfile.parse_file(filename)`
+Parse a Dockerfile by filename.
+Returns a `tuple` of `dockerfile.Command` objects representing each layer of
+the Dockerfile.
+Possible exceptions:
+- `dockerfile.GoIOError`: The file could not be opened.
+- `dockerfile.GoParseError`: The Dockerfile was not parseable.
+```python
+>>> pprint.pprint(dockerfile.parse_file('testfiles/Dockerfile.ok'))
+(Command(cmd='from', sub_cmd=None, json=False, original='FROM ubuntu:xenial', start_line=1, flags=(), value=('ubuntu:xenial',)),
+ Command(cmd='cmd', sub_cmd=None, json=True, original='CMD ["echo", "hi"]', start_line=2, flags=(), value=('echo', 'hi')))
+```
+#### `dockerfile.parse_string(s)`
+Parse a dockerfile using a string.
+Returns a `tuple` of `dockerfile.Command` objects representing each layer of
+the Dockerfile.
+Possible exceptions:
+- `dockerfile.GoParseError`: The Dockerfile was not parseable.
+```python
+>>> dockerfile.parse_string('FROM ubuntu:xenial')
+(Command(cmd='from', sub_cmd=None, json=False, original='FROM ubuntu:xenial', start_line=1, flags=(), value=('ubuntu:xenial',)),)
+```
+## go library
+Slightly more convenient than the api provided by docker/docker? Might not be
+terribly useful -- the main point of this repository was a python wrapper.
+### Installation
+```
+go get github.com/asottile/dockerfile
+```
+### Usage
+[godoc](https://godoc.org/github.com/asottile/dockerfile)
+
+%package -n python3-dockerfile
+Summary: Parse a dockerfile into a high-level representation using the official go parser.
+Provides: python-dockerfile
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-dockerfile
+The goal of this repository is to provide a wrapper around
+[docker/docker](https://github.com/docker/docker)'s parser for dockerfiles.
+## python library
+### Installation
+This project uses [setuptools-golang](https://github.com/asottile/setuptools-golang)
+when built from source. To build from source you'll need a go compiler.
+If you're using linux and sufficiently new pip (>=8.1) you should be able to
+just download prebuilt manylinux1 wheels.
+```
+pip install dockerfile
+```
+### Usage
+There's three api functions provided by this library:
+#### `dockerfile.all_cmds()`
+List all of the known dockerfile cmds.
+```python
+>>> dockerfile.all_cmds()
+('add', 'arg', 'cmd', 'copy', 'entrypoint', 'env', 'expose', 'from', 'healthcheck', 'label', 'maintainer', 'onbuild', 'run', 'shell', 'stopsignal', 'user', 'volume', 'workdir')
+```
+#### `dockerfile.parse_file(filename)`
+Parse a Dockerfile by filename.
+Returns a `tuple` of `dockerfile.Command` objects representing each layer of
+the Dockerfile.
+Possible exceptions:
+- `dockerfile.GoIOError`: The file could not be opened.
+- `dockerfile.GoParseError`: The Dockerfile was not parseable.
+```python
+>>> pprint.pprint(dockerfile.parse_file('testfiles/Dockerfile.ok'))
+(Command(cmd='from', sub_cmd=None, json=False, original='FROM ubuntu:xenial', start_line=1, flags=(), value=('ubuntu:xenial',)),
+ Command(cmd='cmd', sub_cmd=None, json=True, original='CMD ["echo", "hi"]', start_line=2, flags=(), value=('echo', 'hi')))
+```
+#### `dockerfile.parse_string(s)`
+Parse a dockerfile using a string.
+Returns a `tuple` of `dockerfile.Command` objects representing each layer of
+the Dockerfile.
+Possible exceptions:
+- `dockerfile.GoParseError`: The Dockerfile was not parseable.
+```python
+>>> dockerfile.parse_string('FROM ubuntu:xenial')
+(Command(cmd='from', sub_cmd=None, json=False, original='FROM ubuntu:xenial', start_line=1, flags=(), value=('ubuntu:xenial',)),)
+```
+## go library
+Slightly more convenient than the api provided by docker/docker? Might not be
+terribly useful -- the main point of this repository was a python wrapper.
+### Installation
+```
+go get github.com/asottile/dockerfile
+```
+### Usage
+[godoc](https://godoc.org/github.com/asottile/dockerfile)
+
+%package help
+Summary: Development documents and examples for dockerfile
+Provides: python3-dockerfile-doc
+%description help
+The goal of this repository is to provide a wrapper around
+[docker/docker](https://github.com/docker/docker)'s parser for dockerfiles.
+## python library
+### Installation
+This project uses [setuptools-golang](https://github.com/asottile/setuptools-golang)
+when built from source. To build from source you'll need a go compiler.
+If you're using linux and sufficiently new pip (>=8.1) you should be able to
+just download prebuilt manylinux1 wheels.
+```
+pip install dockerfile
+```
+### Usage
+There's three api functions provided by this library:
+#### `dockerfile.all_cmds()`
+List all of the known dockerfile cmds.
+```python
+>>> dockerfile.all_cmds()
+('add', 'arg', 'cmd', 'copy', 'entrypoint', 'env', 'expose', 'from', 'healthcheck', 'label', 'maintainer', 'onbuild', 'run', 'shell', 'stopsignal', 'user', 'volume', 'workdir')
+```
+#### `dockerfile.parse_file(filename)`
+Parse a Dockerfile by filename.
+Returns a `tuple` of `dockerfile.Command` objects representing each layer of
+the Dockerfile.
+Possible exceptions:
+- `dockerfile.GoIOError`: The file could not be opened.
+- `dockerfile.GoParseError`: The Dockerfile was not parseable.
+```python
+>>> pprint.pprint(dockerfile.parse_file('testfiles/Dockerfile.ok'))
+(Command(cmd='from', sub_cmd=None, json=False, original='FROM ubuntu:xenial', start_line=1, flags=(), value=('ubuntu:xenial',)),
+ Command(cmd='cmd', sub_cmd=None, json=True, original='CMD ["echo", "hi"]', start_line=2, flags=(), value=('echo', 'hi')))
+```
+#### `dockerfile.parse_string(s)`
+Parse a dockerfile using a string.
+Returns a `tuple` of `dockerfile.Command` objects representing each layer of
+the Dockerfile.
+Possible exceptions:
+- `dockerfile.GoParseError`: The Dockerfile was not parseable.
+```python
+>>> dockerfile.parse_string('FROM ubuntu:xenial')
+(Command(cmd='from', sub_cmd=None, json=False, original='FROM ubuntu:xenial', start_line=1, flags=(), value=('ubuntu:xenial',)),)
+```
+## go library
+Slightly more convenient than the api provided by docker/docker? Might not be
+terribly useful -- the main point of this repository was a python wrapper.
+### Installation
+```
+go get github.com/asottile/dockerfile
+```
+### Usage
+[godoc](https://godoc.org/github.com/asottile/dockerfile)
+
+%prep
+%autosetup -n dockerfile-3.2.0
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-dockerfile -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 3.2.0-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..7d38e83
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+e6992512c9af1c8cf4aa94804d3b072e dockerfile-3.2.0.tar.gz