Skip to content

Commit

Permalink
Update README shields and CI sections
Browse files Browse the repository at this point in the history
  • Loading branch information
Aareon committed Sep 21, 2024
1 parent 959fa36 commit b46945b
Showing 1 changed file with 51 additions and 17 deletions.
68 changes: 51 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# python-geonames

[![Tests](https://img.shields.io/github/workflow/status/Aareon/python-geonames/tests?label=tests)](https://github.com/Aareon/python-geonames/actions)
[![Mypy](https://img.shields.io/badge/mypy-checked-blue)](https://github.com/Aareon/python-geonames/actions)
[![Coverage](https://img.shields.io/codecov/c/github/Aareon/python-geonames)](https://codecov.io/gh/Aareon/python-geonames)
[![Python tests](https://github.com/Aareon/python-geonames/actions/workflows/python-tests.yml/badge.svg)](https://github.com/Aareon/python-geonames/actions/workflows/python-tests.yml)
[![codecov](https://codecov.io/gh/Aareon/python-geonames/branch/main/graph/badge.svg)](https://codecov.io/gh/Aareon/python-geonames)
[![Python Version](https://img.shields.io/pypi/pyversions/python-geonames.svg)](https://pypi.org/project/python-geonames/)
[![License](https://img.shields.io/github/license/Aareon/python-geonames.svg)](https://github.com/Aareon/python-geonames/blob/main/LICENSE)

Expand Down Expand Up @@ -53,12 +52,12 @@ if __name__ == "__main__":

### Custom Configuration

You can customize the configuration by modifying the `Config` object:
You can customize the configuration by modifying the `GeoNamesConfig` object:

```python
from geonames.config import Config
from geonames.config import Config as GeoNamesConfig

config = Config()
config = GeoNamesConfig()
config.SAVE_DIR = Path("/custom/path/to/geonames_data")
config.DATABASE_URL = "sqlite:///custom_database.db"
# Add other configuration options as needed
Expand Down Expand Up @@ -128,30 +127,48 @@ if __name__ == "__main__":

For more detailed usage instructions, please refer to the [documentation](https://github.com/Aareon/python-geonames/wiki).

## Continuous Integration

This project uses GitHub Actions for continuous integration. The workflow runs tests on Python 3.10 and 3.11, and reports code coverage.

To set up the GitHub Action:

1. Copy the contents of the `.github/workflows/python-tests.yml` file from this repository to your own repository.

2. Ensure your repository has the necessary secrets set up:
- `GITHUB_TOKEN`: This is automatically provided by GitHub Actions.

3. Make sure your `pyproject.toml` file includes all necessary dependencies, including test and development dependencies.

4. Sign up for a [Codecov](https://codecov.io/) account and add your repository.

5. The GitHub Action will now run automatically on every push to the `main` branch and every pull request targeting the `main` branch.

You can view the status of the tests and coverage in the shields at the top of this README.

## Development

To set up the development environment:
This project uses Poetry for dependency management. To set up the development environment:

1. Clone the repository:
1. Install Poetry if you haven't already:
```bash
git clone https://github.com/Aareon/python-geonames.git
cd python-geonames
curl -sSL https://install.python-poetry.org | python3 -
```

2. Create a virtual environment and activate it:
2. Clone the repository:
```bash
python -m venv venv
source venv/bin/activate # On Windows, use \`venv\\Scripts\\activate\`
git clone https://github.com/Aareon/python-geonames.git
cd python-geonames
```

3. Install the development dependencies:
3. Install the project dependencies:
```bash
pip install -r requirements-dev.txt
poetry install --with test,develop
```

4. Install the pre-commit hooks:
4. Activate the virtual environment:
```bash
pre-commit install
poetry shell
```

## Running Tests
Expand All @@ -176,6 +193,23 @@ To run type checking with mypy:
mypy geonames
```

## Code Formatting

This project uses `black` for code formatting and `isort` for import sorting. To format your code:

```bash
black .
isort .
```

## Linting

To run the linter:

```bash
ruff check .
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
Expand Down

0 comments on commit b46945b

Please sign in to comment.