Metadata-Version: 2.1
Name: myrepoutils
Version: 0.1.4
Summary: 
Author: mazzasaverio
Author-email: saverio3107@gmail.com
Requires-Python: >=3.8
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Description-Content-Type: text/markdown

To deploy and manage a Python package on PyPI, with your code hosted on GitHub, follow these refined steps:

### 1. Install Poetry

Poetry is a Python dependency management and packaging tool. Begin by installing it via your terminal:

```bash
curl -sSL https://install.python-poetry.org | python3 -
```

Ensure Poetry's path is included in your system's PATH to use it globally.

### 2. Initialize and Configure Poetry

- **Initialize Poetry**: In your project's root directory (e.g., `/home/sam/github/myrepoutils`), run the following to create a `pyproject.toml` file. This file is essential for Poetry to recognize and manage your project.

  ```bash
  cd /home/sam/github/myrepoutils
  poetry init
  ```

- **Configure `pyproject.toml`**: Edit the `pyproject.toml` to include your package's details, like name, version, description, authors, and dependencies. Here's an example configuration:

  ```toml
  [tool.poetry]
  name = "myrepoutils"
  version = "0.1.0"
  description = "A brief description of your package"
  authors = ["Your Name <you@example.com>"]

  [tool.poetry.dependencies]
  python = "^3.11"

  [tool.poetry.dev-dependencies]
  pytest = "^6.2.4"
  ```

### 3. Version Your Package

Adhere to Semantic Versioning (SemVer), which uses a `MAJOR.MINOR.PATCH` format:

- Increment the `MAJOR` version for incompatible API changes.
- Increment the `MINOR` version for new, backward-compatible functionalities.
- Increment the `PATCH` version for backward-compatible bug fixes.

Based on your changes, update your version accordingly in the `pyproject.toml` file.

### 4. Build Your Package

With your `pyproject.toml` set up, build your package using Poetry:

```bash
poetry build
```

This command creates a distributable package in the `dist` folder.

### 5. Publish Your Package to PyPI

- **Create a PyPI Account**: Ensure you have an account on [PyPI](https://pypi.org/).
- **Publish**: Use Poetry to publish your package to PyPI. When prompted, enter your PyPI credentials:

  ```bash
  poetry publish
  ```

### 6. Update Your Package

To release new versions:

1. Update the version in `pyproject.toml` as per semantic versioning.
2. Rebuild and republish your package:

   ```bash
   poetry version patch  # Use `minor` or `major` for significant updates.
   poetry build
   poetry publish
   ```

### Additional Tips:

- Verify your package name is unique on PyPI.
- Test your package locally before publishing.
- Consider implementing a CI/CD pipeline for automated testing and deployment.

This streamlined guide facilitates the creation and publication of a Python package using Poetry on platforms like Ubuntu, ensuring adherence to best practices in the Python community.

### Initial Setup in the New Environment

1. **Create and Activate a New Conda Environment**: First, ensure you have a dedicated environment for your project to avoid dependency conflicts. Use Conda to create and activate a new environment:

   ```bash
   conda create --name myprojectenv python=3.11
   conda activate myprojectenv
   ```

   Adjust `python=3.11` to the version you need.

2. **Install the Package**: Install `myrepoutils` directly from PyPI using pip (Conda environments can use pip):

   ```bash
   pip install myrepoutils==0.1.2
   ```

   Specifying the version ensures you get the exact release you're after.

### Managing Frequent Updates

When you update `myrepoutils`, you'll need to follow these steps to make the latest version available in your Conda environment:

1. **Update and Publish Your Package on PyPI**: After making changes to `myrepoutils`, increment the version number following [Semantic Versioning](https://semver.org/) (e.g., to `0.1.3`), rebuild, and publish the updated package to PyPI.

2. **Upgrade the Package in Your Environment**: To use the latest version in your Conda environment, upgrade `myrepoutils` using pip:

   ```bash
   pip install --upgrade myrepoutils
   ```

   This command updates the package to the latest version available on PyPI.

### Recommendations for Efficient Workflow

- **Automate Version Bumping**: Consider using tools or scripts to automate the version bumping and package publishing process, especially if updates are frequent.

- **Use Environment Files**: For projects involving multiple dependencies, it's practical to maintain a Conda environment file (`environment.yml`) or a pip requirements file (`requirements.txt`). This approach simplifies environment setup and ensures consistency across installations. However, for a single package that's frequently updated, direct pip installation commands as shown above are more straightforward.

- **Consider Local Development Installations**: If `myrepoutils` is under active development and you're testing changes in real-time, you might install the package in editable mode (`pip install -e .`) in your development environment. This setup lets you see changes immediately without reinstalling after each update. Note that for production or stable environments, it's better to install the fixed versions as described.

By following these guidelines, you can efficiently manage and use your `myrepoutils` package across different projects and environments, ensuring you always have access to the latest features and fixes you've implemented.

