Skip to content

Commit b49f7f0

Browse files
committed
Consolidate dependencies
- have all dependencies in pyproject.toml only - remove requirements.txt files and tox.ini - adapt contributing guide for documentation creation - fix some dockerfile warnings
1 parent 9f6d8bc commit b49f7f0

16 files changed

Lines changed: 89 additions & 93 deletions

.github/workflows/dockerfiles/Dockerfile_debian

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
# limitations under the License.
1414

1515
FROM debian
16-
MAINTAINER jmcgeheeiv@users.noreply.github.com
1716

1817
RUN apt-get update && apt-get install -y locales
1918
RUN locale-gen en_US.UTF-8
20-
ENV LANG en_US.UTF-8
21-
ENV LANGUAGE en_US:en
22-
ENV LC_ALL en_US.UTF-8
19+
ENV LANG=en_US.UTF-8
20+
ENV LANGUAGE=en_US:en
21+
ENV LC_ALL=en_US.UTF-8
2322
ARG github_repo=pytest-dev/pyfakefs
2423
ARG github_branch=main
2524

@@ -40,12 +39,11 @@ RUN WORK_DIR=`ls -d work/*`; mv $WORK_DIR work/pyfakefs
4039
RUN chown -R pyfakefs:pyfakefs work/pyfakefs
4140
WORKDIR work/pyfakefs
4241
RUN python3 -m venv ../venv
43-
RUN ../venv/bin/pip install -r requirements.txt
44-
RUN ../venv/bin/pip install -r extra_requirements.txt
42+
RUN ../venv/bin/pip install --group dev --group extra
4543
RUN ../venv/bin/pip install parquet pyarrow
4644
RUN ../venv/bin/pip install -e .
4745

4846
USER pyfakefs
49-
ENV PYTHONPATH work/pyfakefs
47+
ENV PYTHONPATH=work/pyfakefs
5048
ENV TEST_REAL_FS=1
5149
CMD ["../venv/bin/pytest", "pyfakefs/pytest_tests", "pyfakefs/tests"]

.github/workflows/dockerfiles/Dockerfile_fedora

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
# limitations under the License.
1414

1515
FROM fedora:latest
16-
MAINTAINER jmcgeheeiv@users.noreply.github.com
1716

18-
ENV LANG en_US.UTF-8
19-
ENV LANGUAGE en_US:en
20-
ENV LC_ALL en_US.UTF-8
17+
ENV LANG=en_US.UTF-8
18+
ENV LANGUAGE=en_US:en
19+
ENV LC_ALL=en_US.UTF-8
2120
ARG github_repo=pytest-dev/pyfakefs
2221
ARG github_branch=main
2322

@@ -31,11 +30,10 @@ RUN mkdir -p work \
3130
RUN WORK_DIR=`ls -d work/*`; mv $WORK_DIR work/pyfakefs
3231
RUN chown -R pyfakefs:pyfakefs work/pyfakefs
3332
WORKDIR work/pyfakefs
34-
RUN pip3 install -r requirements.txt
35-
RUN pip3 install -r extra_requirements.txt
33+
RUN pip3 install --group dev --group extra
3634
RUN pip3 install -e .
3735

3836
USER pyfakefs
39-
ENV PYTHONPATH work/pyfakefs
37+
ENV PYTHONPATH=work/pyfakefs
4038
ENV TEST_REAL_FS=1
4139
CMD ["pytest", "pyfakefs/pytest_tests", "pyfakefs/tests"]

.github/workflows/dockerfiles/Dockerfile_redhat

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
FROM registry.access.redhat.com/ubi9/ubi
16-
LABEL maintainer="John McGehee"
1716

1817
ARG github_repo=pytest-dev/pyfakefs
1918
ARG github_branch=main
@@ -22,9 +21,9 @@ RUN yum update --disablerepo=* --enablerepo=ubi-9-appstream-rpms --enablerepo=ub
2221
RUN yum install -y python3.12 python3.12-pip unzip wget
2322
RUN python3.12 --version
2423

25-
ENV LANG en_US.UTF-8
26-
ENV LANGUAGE en_US:en
27-
ENV LC_COLLATE C.UTF-8
24+
ENV LANG=en_US.UTF-8
25+
ENV LANGUAGE=en_US:en
26+
ENV LC_COLLATE=C.UTF-8
2827

2928
RUN useradd pyfakefs
3029

@@ -34,11 +33,11 @@ RUN mkdir -p work \
3433
RUN WORK_DIR=`ls -d work/*`; mv $WORK_DIR work/pyfakefs
3534
RUN chown -R pyfakefs:pyfakefs work/pyfakefs
3635
WORKDIR work/pyfakefs
37-
RUN pip3.12 install -r requirements.txt
38-
RUN pip3.12 install -r extra_requirements.txt
36+
RUN python3.12 -m pip install --upgrade pip
37+
RUN pip3.12 install --group dev --group extra
3938
RUN pip3.12 install -e .
4039

4140
USER pyfakefs
42-
ENV PYTHONPATH work/pyfakefs
41+
ENV PYTHONPATH=work/pyfakefs
4342
ENV TEST_REAL_FS=1
4443
CMD ["python3.12", "-m", "pytest", "pyfakefs/pytest_tests", "pyfakefs/tests"]

.github/workflows/dockerfiles/Dockerfile_ubuntu

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
# limitations under the License.
1414

1515
FROM ubuntu
16-
MAINTAINER jmcgeheeiv@users.noreply.github.com
1716

1817
RUN apt-get update && apt-get install -y locales
1918
RUN locale-gen en_US.UTF-8
20-
ENV LANG en_US.UTF-8
21-
ENV LANGUAGE en_US:en
22-
ENV LC_ALL en_US.UTF-8
19+
ENV LANG=en_US.UTF-8
20+
ENV LANGUAGE=en_US:en
21+
ENV LC_ALL=en_US.UTF-8
2322
ARG github_repo=pytest-dev/pyfakefs
2423
ARG github_branch=main
2524

@@ -40,12 +39,12 @@ RUN WORK_DIR=`ls -d work/*`; mv $WORK_DIR work/pyfakefs
4039
RUN chown -R pyfakefs:pyfakefs work/pyfakefs
4140
WORKDIR work/pyfakefs
4241
RUN python3 -m venv ../venv
43-
RUN ../venv/bin/pip install -r requirements.txt
44-
RUN ../venv/bin/pip install -r extra_requirements.txt
42+
RUN ../venv/bin/python3 -m pip install --upgrade pip
43+
RUN ../venv/bin/pip install --group dev --group extra
4544
RUN ../venv/bin/pip install parquet pyarrow
4645
RUN ../venv/bin/pip install -e .
4746

4847
USER pyfakefs
49-
ENV PYTHONPATH work/pyfakefs
48+
ENV PYTHONPATH=work/pyfakefs
5049
ENV TEST_REAL_FS=1
5150
CMD ["../venv/bin/pytest", "pyfakefs/pytest_tests", "pyfakefs/tests"]

.github/workflows/release-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
python-version: [ '3.10' ]
17+
python-version: [ '3.13' ]
1818

1919
steps:
2020
- uses: actions/checkout@v6

.github/workflows/testsuite.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ jobs:
5454
uses: actions/cache@v5
5555
with:
5656
path: ${{ steps.pip-cache.outputs.dir }}
57-
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/extra_requirements.txt') }}
57+
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/pyproject.toml') }}
5858
restore-keys: |
5959
${{ matrix.os }}-${{ matrix.python-version }}-pip-
6060
6161
- name: Install dependencies
6262
run: |
6363
pip install setuptools wheel
64-
pip install -r requirements.txt
64+
pip install --group dev
6565
- name: Run unit tests without extra packages as non-root user
6666
run: |
6767
export TEST_REAL_FS=1
@@ -77,7 +77,7 @@ jobs:
7777
- name: Install extra dependencies
7878
if: matrix.os != 'windows-latest' || matrix.python-version != 'pypy-3.11'
7979
run: |
80-
pip install -r extra_requirements.txt
80+
pip install --group extra
8181
pip install zstandard cffi # needed to test #910
8282
shell: bash
8383
- name: Run unit tests with extra packages as non-root user
@@ -123,7 +123,7 @@ jobs:
123123
- name: Install dependencies
124124
run: |
125125
python -m pip install --upgrade pip
126-
python -m pip install -r requirements.txt
126+
python -m pip install --group dev
127127
python -m pip install -U pytest==${{ matrix.pytest-version }}
128128
python -m pip install pandas parquet pyarrow
129129
python -m pip install -e .
@@ -150,8 +150,7 @@ jobs:
150150
python-version: ${{ matrix.python-version }}
151151
- name: Install dependencies
152152
run: |
153-
pip install -r requirements.txt
154-
pip install -r extra_requirements.txt
153+
pip install .[dev,extra]
155154
pip install pytest-find-dependencies
156155
- name: Check dependencies
157156
run: python -m pytest --find-dependencies pyfakefs/tests

.readthedocs.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ sphinx:
1414

1515
python:
1616
install:
17-
- requirements: docs/requirements.txt
17+
- method: pip
18+
path: .
19+
extra_requirements:
20+
- doc

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The released versions correspond to PyPI releases.
99

1010
### Infrastructure
1111
* added PyPy 3.11 to CI, added PyPy builds for all OSes
12+
* use only `pyproject.toml` for dependencies, moved `tox` configuration into `pyproject.toml`
1213

1314
### Fixes
1415
* fixed a problem with `readable` raising an error on a file object.

CONTRIBUTING.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

22
# Contributing to pyfakefs
33

4-
We welcome any contributions that help to improve pyfakefs for the community.
4+
We welcome any contributions that help to improve `pyfakefs` for the community.
55
Contributions may include bug reports, bug fixes, new features, infrastructure enhancements, or
66
documentation updates.
77

88
## How to contribute
99

1010
### Reporting Bugs
1111

12-
If you think you found a bug in pyfakefs, you can [create an issue](https://help.github.com/articles/creating-an-issue/).
12+
If you think you found a bug in `pyfakefs`, you can [create an issue](https://help.github.com/articles/creating-an-issue/).
1313
Before filing the bug, please check, if it still exists in the [main branch](https://github.com/pytest-dev/pyfakefs).
1414
If you can reproduce the problem, please provide enough information so that it can be reproduced by other developers.
1515
This includes:
@@ -21,9 +21,9 @@ For better readability, you may use [markdown code formatting](https://help.gith
2121

2222
### Proposing Enhancements
2323

24-
If you need a specific feature that is not implemented, or have an idea for the next
25-
exciting gimmick in pyfakefs, you can also create a respective issue.
26-
Of course - implementing it yourself is the best chance to get it done!
24+
If you need a specific feature that is not implemented, or have an idea for a useful addition,
25+
you may also create a respective issue.
26+
As usually, implementing it yourself is the best chance to get it done!
2727
The next item has some information on doing this.
2828

2929
### Contributing Code
@@ -34,25 +34,33 @@ develop on a feature branch, and [create a pull request](https://help.github.com
3434
There are a few things to consider for contributing code:
3535
* We ensure the [PEP-8 coding style](https://www.python.org/dev/peps/pep-0008/)
3636
by using [black](https://pypi.org/project/black/) auto-format in a
37-
pre-commit hook; you can locally install
38-
[pre-commit](https://pypi.org/project/pre-commit/) to run the linter
39-
tests on check-in or on demand (`pre-commit run --all-files`)
40-
* Use the [Google documentation style](https://google.github.io/styleguide/pyguide.html) to document new public classes or methods
41-
* Provide unit tests for bug fixes or new functionality - check the existing tests for examples
42-
* Provide meaningful commit messages - it is ok to amend the commits to improve the comments
43-
* Check that the automatic GitHub Action CI tests all pass for your pull request
44-
* Be ready to adapt your changes after a code review
37+
pre-commit hook. We recommend to locally install
38+
[pre-commit](https://pypi.org/project/pre-commit/) (`pre-commit install`) to run the linter
39+
tests on check-in, or run the tests on demand (`pre-commit run --all-files`).
40+
* Use the [Google documentation style](https://google.github.io/styleguide/pyguide.html) to document new public classes or methods.
41+
* Provide unit tests for bug fixes or new functionality - check the existing tests for examples.
42+
* Provide meaningful commit messages - it is ok to amend the commits to improve the comments.
43+
* Check that the automatic GitHub Action CI tests all pass for your pull request.
44+
* Be ready to adapt your changes after a code review.
4545

4646
### Contributing Documentation
4747

4848
If you want to improve the existing documentation, you can do this also using a pull request.
4949
You can contribute to:
5050
* the source code documentation using [Google documentation style](https://google.github.io/styleguide/pyguide.html)
5151
* the [README](https://github.com/pytest-dev/pyfakefs/blob/main/README.md) using [markdown syntax](https://help.github.com/articles/basic-writing-and-formatting-syntax/)
52-
* the documentation published on [Read the Docs](https://pytest-pyfakefs.readthedocs.io/en/latest/),
53-
located in the `docs` directory (call `make html` from that directory).
54-
For building the documentation, you will need [sphinx](http://sphinx.pocoo.org/).
55-
* [this file](https://github.com/pytest-dev/pyfakefs/blob/main/CONTRIBUTING.md)
56-
if you want to enhance the contributing guide itself
52+
* the documentation published on [Read the Docs](https://pytest-pyfakefs.readthedocs.io/en/latest/) and located in the `docs` directory,
53+
using [reStructuredText syntax](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html)
5754

58-
Thanks for taking the time to contribute to pyfakefs!
55+
To build the documentation locally, you need to install the needed dependencies by calling
56+
```
57+
python -m pip install .[doc]
58+
```
59+
from your source directory. Then you can create the documentation:
60+
```
61+
cd docs
62+
make html
63+
```
64+
The generated documentation will be located under *docs/html*.
65+
66+
Thank you for taking the time to contribute to pyfakefs!

Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@
2323
# docker run -t pyfakefs
2424

2525
FROM ubuntu
26-
MAINTAINER jmcgeheeiv@users.noreply.github.com
2726

2827
# The Ubuntu base container does not specify a locale.
2928
# pyfakefs tests require at least the Latin1 character set.
3029
RUN apt-get update && apt-get install -y locales
3130
RUN locale-gen en_US.UTF-8
32-
ENV LANG en_US.UTF-8
33-
ENV LANGUAGE en_US:en
34-
ENV LC_ALL en_US.UTF-8
31+
ENV LANG=en_US.UTF-8
32+
ENV LANGUAGE=en_US:en
33+
ENV LC_ALL=en_US.UTF-8
3534

3635
RUN apt-get update && apt-get install -y \
3736
python3-pip \
@@ -45,9 +44,8 @@ RUN wget https://github.com/pytest-dev/pyfakefs/archive/main.zip \
4544
&& unzip main.zip \
4645
&& chown -R pyfakefs:pyfakefs /pyfakefs-main
4746
WORKDIR /pyfakefs-main
48-
RUN pip3 install -r requirements.txt
49-
RUN pip3 install -r extra_requirements.txt
47+
RUN pip3 install --group dev --group extra
5048

5149
USER pyfakefs
52-
ENV PYTHONPATH /pyfakefs-main
50+
ENV PYTHONPATH=/pyfakefs-main
5351
CMD ["python3", "-m", "pyfakefs.tests.all_tests"]

0 commit comments

Comments
 (0)