diff --git a/Pygments-2.2.0.tar.gz b/Pygments-2.2.0.tar.gz new file mode 100644 index 0000000..870d1b2 Binary files /dev/null and b/Pygments-2.2.0.tar.gz differ diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 502f8e6..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# python-pygments - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 613fcaf..0000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# python-pygments - -#### 介绍 -{**以下是码云平台说明,您可以替换此简介** -码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/import-directive.patch b/import-directive.patch new file mode 100644 index 0000000..cc25063 --- /dev/null +++ b/import-directive.patch @@ -0,0 +1,12 @@ +diff -ur Pygments-2.2.0/pygments/sphinxext.py Pygments-2.2.0.patch/pygments/sphinxext.py +--- Pygments-2.2.0/pygments/sphinxext.py 2017-01-22 16:01:32.000000000 -0500 ++++ Pygments-2.2.0.patch/pygments/sphinxext.py 2018-03-19 12:57:52.099927570 -0400 +@@ -16,7 +16,7 @@ + + from docutils import nodes + from docutils.statemachine import ViewList +-from sphinx.util.compat import Directive ++from docutils.parsers.rst import Directive + from sphinx.util.nodes import nested_parse_with_titles + + diff --git a/pep479.patch b/pep479.patch new file mode 100644 index 0000000..46fda97 --- /dev/null +++ b/pep479.patch @@ -0,0 +1,34 @@ +diff -r 7941677dc77d pygments/lexers/lisp.py +--- a/pygments/lexers/lisp.py Mon Mar 13 19:16:03 2017 +0000 ++++ b/pygments/lexers/lisp.py Wed Jul 04 18:03:07 2018 +0200 +@@ -2327,13 +2327,13 @@ + token = Name.Function if token == Literal else token + yield index, token, value + +- raise StopIteration ++ return + + def _process_signature(self, tokens): + for index, token, value in tokens: + if token == Literal and value == '}': + yield index, Punctuation, value +- raise StopIteration ++ return + elif token in (Literal, Name.Function): + token = Name.Variable if value.istitle() else Keyword.Type + yield index, token, value +diff -r 7941677dc77d pygments/lexers/sql.py +--- a/pygments/lexers/sql.py Mon Mar 13 19:16:03 2017 +0000 ++++ b/pygments/lexers/sql.py Wed Jul 04 18:03:07 2018 +0200 +@@ -347,7 +347,10 @@ + # Emit the output lines + out_token = Generic.Output + while 1: +- line = next(lines) ++ try: ++ line = next(lines) ++ except StopIteration: ++ return + mprompt = re_prompt.match(line) + if mprompt is not None: + # push the line back to have it processed by the prompt diff --git a/python-pygments.spec b/python-pygments.spec new file mode 100644 index 0000000..b228143 --- /dev/null +++ b/python-pygments.spec @@ -0,0 +1,89 @@ +%global _description \ +Pygments is a generic syntax highlighter suitable for use \ +in code hosting, forums, wikis or other applications that \ +need to prettify source code. Highlights are: \ + * a wide range of over 500 languages and other text \ + formats is supported \ + * special attention is paid to details that increase \ + highlighting quality \ + * support for new languages and formats are added easily; \ + most languages use a simple regex-based lexing mechanism \ + * a number of output formats is available, among them HTML, \ + RTF, LaTeX and ANSI sequences \ + * it is usable as a command-line tool and as a library \ + * … and it highlights even Perl 6! + +Name: python-pygments +Summary: Syntax highlighting engine written in Python +Version: 2.2.0 +Release: 15 +License: BSD +URL: http://pygments.org/ +Source0: https://pypi.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz + +Patch0: import-directive.patch +Patch1: pep479.patch + +BuildArch: noarch + +%description +%{_description} + +%package -n python2-pygments +BuildRequires: python2-devel >= 2.4, python2-setuptools +BuildRequires: python2-nose, python2-sphinx +Summary: Syntax highlighting engine written in Python +%{?python_provide:%python_provide python2-pygments} + +%description -n python2-pygments +%{_description} + +%package -n python3-pygments +BuildRequires: python3-devel, python3-setuptools, python3-nose +Summary: Syntax highlighting engine written in Python +%{?python_provide:%python_provide python3-pygments} + +%description -n python3-pygments +%{_description} + +%package_help + +%prep +%autosetup -p1 -n Pygments-%{version} + +%build +%{__sed} -i 's/\r//' LICENSE +%py2_build +%py3_build + +%install +%py2_install +%{__python2} setup.py build_sphinx +pushd doc +install -d %{buildroot}%{_mandir}/man1 +mv pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1 +popd +cp -r doc/docs doc/reST + +%py3_install + +%check +make test PYTHON=%{__python2} +make test PYTHON=%{__python3} + +%files -n python2-pygments +%license LICENSE +%{python2_sitelib}/* + +%files -n python3-pygments +%license LICENSE +%{python3_sitelib}/* +%{_bindir}/pygmentize + +%files help +%doc AUTHORS CHANGES build/sphinx/html doc/reST TODO +%lang(en) %{_mandir}/man1/pygmentize.1* + +%changelog +* Fri Dec 6 2019 caomeng - 2.2.0-15 +- Package init \ No newline at end of file