Repository: kevinconway/rpmvenv (language: python)

Issue:
Add support for marking dirs with extra_files
Signed-off-by: Kevin Conway kevinjacobconway@gmail.com



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..1f0f171
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,97 @@
+name: CI
+on:
+  push:
+    branches:
+      - 'master'
+    tags: [ '*' ]
+  pull_request:
+    branches:
+      - 'master'
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+    timeout-minutes: 5
+    steps:
+      - name: Checkhout
+        uses: actions/checkout@v2
+      - name: Setup Python 3.7
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.7
+      - name: Cache PyPI
+        uses: actions/cache@v2
+        with:
+          key: pip-lint-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
+          path: ~/.cache/pip
+          restore-keys: |
+              pip-lint-
+      - name: Install dependencies
+        run: |
+          python -m pip install -r requirements.txt
+          python -m pip install -r test-requirements.txt
+      - name: pep8
+        run: |
+          pycodestyle rpmvenv/
+          pycodestyle tests/
+      - name: pyflakes
+        run: |
+          pyflakes rpmvenv/
+          pyflakes tests/
+  test:
+    name: Test
+    needs: lint
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+         pyver: ['2.7', '3.5', '3.6', '3.7']
+      fail-fast: true
+    steps:
+      - name: Install deps
+        run: sudo apt update && sudo apt install -y rpm enchant
+      - name: Checkhout
+        uses: actions/checkout@v2.4.0
+      - name: Setup Python ${{ matrix.pyver }}
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.pyver }}
+      - name: Cache PyPI
+        uses: actions/cache@v2
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-pip-${{ matrix.pyver }}-${{ hashFiles('test-requirements.txt') }}
+          restore-keys: |
+              ${{ runner.os }}-pip-${{ matrix.pyver }}-
+      - name: Install dependencies
+        run: |
+          python -m pip install virtualenv==20.10.0
+          if [[ "$(python --version 2>&1)" =~ Python\ (2\.*) ]]; then pip install -U jinja2; else echo "Skipping JINJA2 for $(python --version 2>&1)."; fi
+          python -m pip install -r requirements.txt
+          python -m pip install -r test-requirements.txt
+          python -m pip install -e ./
+      - name: Run tests
+        env:
+          PYTHONPATH: .
+        run: |
+          py.test -v --skip-binary-strip --python-git-url="https://github.com/kevinconway/rpmvenv_manylinux_issue.git" tests/
+          py.test -v --python-git-url="https://github.com/kevinconway/rpmvenv_manylinux_issue.git" tests/
+  build-and-publish:
+    name: Build and publish
+    needs: test
+    runs-on: ubuntu-latest
+    if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python 2.7
+        uses: actions/setup-python@v2
+        with:
+          python-version: 2.7
+      - name: Install pypa/build
+        run: python -m pip install build
+      - name: Build a binary wheel and a source tarball
+        run: python -m build --sdist --wheel --outdir dist/ .
+      - name: Publish package to PyPI
+        uses: pypa/gh-action-pypi-publish@release/v1
+        with:
+          password: ${{ secrets.PYPI_API_TOKEN }}
diff --git a/.gitignore b/.gitignore
index a461ffe..ad4c3c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,6 +54,7 @@ target/
 
 # IntelliJ / PyCharm
 *.iml
+.idea/
 
 # Vim
 *.swp
diff --git a/requirements.txt b/requirements.txt
index 0a602e6..d995bf3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,6 @@
-jinja2
-venvctrl
-argparse
-confpy
-ordereddict
-semver
+jinja2==2.11.3
+venvctrl==0.4.2
+argparse==1.4.0
+confpy==0.11.0
+ordereddict==1.1
+semver==2.9.1


Test patch:
diff --git a/test-requirements.txt b/test-requirements.txt
index f41a4bf..62d8cf1 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,6 +1,5 @@
 isort==4.2.15
-pycodestyle
-pyflakes; python_version=='2.7' or python_version>='3.4'
+pycodestyle==2.8.0
+pyflakes==2.4.0; python_version=='2.7' or python_version>='3.4'
 pylint; python_version>='3.4'
-pytest
-pyenchant
+pytest==4.6.11
diff --git a/tests/conftest.py b/tests/conftest.py
index afb6d50..fed9863 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -92,7 +92,8 @@ def qa_skip_buildroot(skip_binary_strip):
 
 
 @pytest.fixture
-def python_config_file(python, skip_binary_strip, use_pip_install, remove_pycache, tmpdir):
+def python_config_file(python, skip_binary_strip, use_pip_install,
+                       remove_pycache, tmpdir):
     """Get a config file path."""
     extra_filename = 'README.rst'
     json_file = str(tmpdir.join('conf.json'))
@@ -156,7 +157,12 @@ def python_config_file(python, skip_binary_strip, use_pip_install, remove_pycach
             "python": python,
             "strip_binaries": not skip_binary_strip,
             "use_pip_install": use_pip_install,
-            "remove_pycache": remove_pycache
+            "remove_pycache": remove_pycache,
+            "flags": [
+                "--always-copy",
+                "--activators",
+                "bash,cshell,fish,powershell,python"
+            ]
         },
         "blocks": {
             "post": ("echo 'Hello'",),
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index 64b1f19..88baf06 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -6,7 +6,6 @@
 from __future__ import unicode_literals
 
 import itertools
-import pytest
 
 from rpmvenv.extensions import loader
 
diff --git a/tests/test_venv.py b/tests/test_venv.py
index f01e954..1cef26d 100644
--- a/tests/test_venv.py
+++ b/tests/test_venv.py
@@ -29,7 +29,8 @@ def test_use_pip_install_on():
 
 
 class TestRemovePycache:
-    cmd = r'find %{venv_dir} -type d -name "__pycache__" -print0 | xargs -0 rm -rf'
+    cmd = r'find %{venv_dir} -type d -name "__pycache__" ' \
+          r'-print0 | xargs -0 rm -rf'
 
     def test_remove_pycache_off(self):
         ext = venv.Extension()
@@ -45,4 +46,3 @@ def test_remove_pycache_on(self):
         spec = Spec()
         ext.generate(config, spec)
         assert self.cmd in str(spec)
-