Commit graph

14 commits

Author SHA1 Message Date
Paul Gauthier
108328b4be CI should only check tests 2023-06-30 14:02:37 -07:00
Paul Gauthier
143d20b1e6 Upgrade to new actions versions 2023-06-17 07:12:05 -07:00
Paul Gauthier
fc30663ce4 aider: work in progress
# Context:
USER: can i use github actions to make it easy to release a new version on github and pypi
ASSISTANT: Yes, you can use GitHub Actions to automate the release process for both GitHub and PyPI. To do this, you'll need to create a new GitHub Actions workflow file and configure it with the necessary steps.

Please follow these steps:

1. Create a new file named `release.yml` in the `.github/workflows/` directory of your repository. If the directory doesn't exist, create it.

```yaml
.github/workflows/release.yml
<<<<<<< ORIGINAL
=======
name: Release

on:
  push:
    tags:
      - 'v*'

jobs:
  build_and_publish:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: 3.x

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install setuptools wheel twine

    - name: Build and publish
      env:
        TWINE_USERNAME: __token__
        TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
      run: |
        python setup.py sdist bdist_wheel
        twine upload dist/*
>>>>>>> UPDATED
```

2. Replace `PYPI_API_TOKEN` in the `TWINE_PASSWORD` line with your actual PyPI API token. You can create an API token by following the instructions in the [PyPI documentation](https://pypi.org/manage/account/token/).

3. Commit and push the changes to your repository.

Now, whenever you push a new tag starting with 'v' (e.g., `v1.0.0`), the GitHub Actions workflow will automatically build and publish your package to PyPI.

Please note that you'll need to have a `setup.py` file in your repository for this workflow to work correctly. If you don't have one, please let me know, and I can help you create one.
2023-06-17 06:44:02 -07:00
Paul Gauthier
82cc64eb6f upgrade actions versions 2023-05-29 06:46:22 -07:00
Paul Gauthier
caa61089d8 add py3.8, 3.9 to actions 2023-05-29 06:43:16 -07:00
paul-gauthier
9abaddb754
Update python-tests.yml 2023-05-29 05:57:27 -07:00
Paul Gauthier
387477d5c2 try running all tests w/ctags 2023-05-27 14:16:58 -07:00
Paul Gauthier
a84f93b9e4 aider: Added step to install "universal ctags" before installing Python dependencies.
# Context:
USER: i need to install the "universal ctags" binary in ubuntu before i run tests
ASSISTANT: To install the "universal ctags" binary in Ubuntu before running tests, you can add a new step in the `.github/workflows/python-tests.yml` file.

```yaml
.github/workflows/python-tests.yml
<<<<<<< ORIGINAL
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
=======
    - name: Install universal ctags
      run: |
        sudo apt-get update
        sudo apt-get install -y universal-ctags

    - name: Install dependencies
      run: |
        python
^C KeyboardInterrupt
USER: sorry, do that again
ASSISTANT: Sure, here's the updated step to install "universal ctags" in the `.github/workflows/python-tests.yml` file.

```yaml
.github/workflows/python-tests.yml
<<<<<<< ORIGINAL
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
=======
    - name: Install universal ctags
      run: |
        sudo apt-get update
        sudo apt-get install -y universal-ctags

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
>>>>>>> UPDATED
```

This change adds a new step to install "universal ctags" before installing the Python dependencies.
2023-05-27 14:16:41 -07:00
Paul Gauthier
9d1b4a9f5d aider: Changed approach to exclude specific test case using unittest module.
# Context:
USER: the  -k 'not test_get_tags_map_with_identifiers' seems to have made it skip all the tests
ASSISTANT: It seems that the `-k` flag with the `not` expression is not working as expected. Let's change the approach and use the `unittest` module to exclude the specific test case. We'll modify the `python-tests.yml` file to achieve this.

```yaml
.github/workflows/python-tests.yml
<<<<<<< ORIGINAL
    - name: Run tests excluding test_get_tags_map_with_identifiers
      run: |
        python -m unittest discover -k 'not test_get_tags_map_with_identifiers'
=======
    - name: Run tests excluding test_get_tags_map_with_identifiers
      run: |
        python -c "import unittest; loader = unittest.TestLoader(); suite = loader.discover('.'); suite_filtered = unittest.TestSuite([t for t in suite if 'test_get_tags_map_with_identifiers' not in str(t)]); unittest.TextTestRunner().run(suite_filtered)"
>>>>>>> UPDATED
```

This change will discover all tests, filter out the `test_get_tags_map_with_identifiers` test case, and then run the remaining tests.
2023-05-27 14:08:32 -07:00
Paul Gauthier
81f54a0322 aider: Excluded test_get_tags_map_with_identifiers from running in GitHub Actions.
# Context:
USER: how can i exclude running test_get_tags_map_with_identifiers from tests/test_repomap.py when tests run in github actions?
ASSISTANT: To exclude the `test_get_tags_map_with_identifiers` test from running in GitHub Actions, you can modify the `python-tests.yml` file to include a command-line option for the `unittest discover` command. You can use the `-k` option to specify a pattern that matches all test methods except `test_get_tags_map_with_identifiers`.

Here's the change you need to make in the `.github/workflows/python-tests.yml` file:

```yaml
.github/workflows/python-tests.yml
<<<<<<< ORIGINAL
    - name: Run tests
      run: |
        python -m unittest discover
=======
    - name: Run tests excluding test_get_tags_map_with_identifiers
      run: |
        python -m unittest discover -k 'not test_get_tags_map_with_identifiers'
>>>>>>> UPDATED
```

This change will exclude the `test_get_tags_map_with_identifiers` test method from running when the GitHub Actions workflow is executed.
2023-05-27 14:03:10 -07:00
Paul Gauthier
775f6fc192 updated python version list 2023-05-27 13:55:37 -07:00
Paul Gauthier
35621f3b11 updated python version list 2023-05-27 13:54:32 -07:00
Paul Gauthier
8967cd6efc updated python version list 2023-05-27 13:51:45 -07:00
Paul Gauthier
203b37a051 aider: Added GitHub Actions workflow for running Python tests on push and pull request to the main branch.
# Context:
USER: how can i run my tests in ci on github?
ASSISTANT: To run your tests in a CI environment on GitHub, you can use GitHub Actions. Here's a step-by-step guide to set up a basic Python testing workflow:

1. Create a new directory named `.github` in the root of your repository if it doesn't exist.
2. Inside the `.github` directory, create another directory named `workflows`.
3. Create a new file named `python-tests.yml` inside the `workflows` directory.

Now, add the following content to the `python-tests.yml` file:

```yaml
.github/workflows/python-tests.yml
<<<<<<< ORIGINAL
=======
name: Python Tests

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.6, 3.7, 3.8, 3.9]

    steps:
    - name: Check out repository
      uses: actions/checkout@v2

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt

    - name: Run tests
      run: |
        python -m unittest discover
>>>>>>> UPDATED
```

This workflow will run your tests on every push and pull request to the `main` branch using Python versions 3.6, 3.7, 3.8, and 3.9.

After you've added the `python-tests.yml` file to your repository, GitHub Actions will automatically start running your tests according to the specified workflow.
2023-05-27 13:48:03 -07:00